|
|
I had read an article in MSDN for changing the proxy setting of options dialog.
It used :
INTERNET_PER_CONN_OPTION_LIST List;
INTERNET_PER_CONN_OPTION Option[1];
unsigned long nSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
Option[0].Value.pszValue = "http://myproxy:8080";
List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST);
List.pszConnection = NULL;
List.dwOptionCount = 1;
List.pOptions = Option;
if(!InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &List, nSize))
printf("InternetQueryOption failed! \n");
But i was unable to find appropriate details for setting other options of the "options" dialog.
Ex: To set Tools->Internet Options->Security->Localintranet->custom level(button)->Anonymous logon option.
An article in MSDN mentioned that setting registry directly is not recommended.Is there an alternative way to solve this issue.
|
|
|
|
|
|
That source helped me set proxy settings.
I also need to set Tools->Internet Options->Security->Localintranet->custom level(button)->Anonymous logon radio button
How to do that?
|
|
|
|
|
I think david answered to this question,right
|
|
|
|
|
vishnuteja wrote: Anonymous logon Radio button must be checked
Check out the values under the following registry key:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\SO\AUTH\LOGON\ANONYMOUS
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
First of all thank u for giving response to my request.But i am unable to get how to use ur solution.
Suppose,i am writing an application which does not work properly if "Anonymous logon" radio button present in Internet options is not checked.So,i want my application to check it before continuing with its normal operation.
But i am unable to get how to do it progamatically in my MFC application.So i want a sample application that sets "Anonymous logon" radio button when i press some button (Say OK button).
Can you provide me a sample application which does that?
(Using something like using InternetSetOption().Not like setting registry manually through RegSetValue("path"))
|
|
|
|
|
Apparently nothing changes under the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings key regarding those radio buttons. Sorry about that.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello all,
I have developed a DLL for HTTPS request. Currently I am printing the output headers and message body. I want to pass this headers and message to the calling application. Can anyone tell me how to do that ?
Thanks for your prompt reply.
Nikhs
Nikhil Trivedi
|
|
|
|
|
(C#)Application.DoEvents () equal WIN32 API ?.
Thanks
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
|
yes,
well I have one application for converting any format to .wmv from the ENCODER SDK 9 SERIES. I think you might asked me before for this!. is it ?
Now the file is converted sucessfully but due to this application is console they used
the following thing.
I am using win32 in .Net(vs2005) using unicode.
how can i handle the event or message pumping in my application.
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pEncoder->PrepareToEncode(VARIANT_TRUE);<br />
}<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pEncoder->Start();<br />
printf("When encoding stops, press a key to close the console window.");<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
<pre>
while(!kbhit())
_asm nop;<br />
</pre><br />
<br />
hr = pEncoder->Stop();<br />
}<br />
}<br />
<br />
<br />
The same thing for conversion. I had see in here.But it is in C#.
here is the link and sample code .
http://www.codeproject.com/Purgatory/ConvertVideoFileFormats.asp[^]
The window handle the console.
The link having the following code.
<br />
<br />
public void EncodeFromConsole()<br />
{<br />
glbEncoder.OnStateChange+=new _IWMEncoderEvents_OnStateChangeEventHandler(this.Encoder_OnStateChange); <br />
bool boolEncodeStart = sEncodeFile(movie_source ,movie_dest );<br />
if(boolEncodeStart)<br />
Console.WriteLine("Encoding successfully started ");<br />
glbboolStartNext= !boolEncodeStart;<br />
FileInfo f = new FileInfo(movie_dest );<br />
<br />
<pre><br />
while (!glbboolStartNext) <br />
{<br />
Application.DoEvents (); <br />
<br />
}<br />
</pre> <br />
<br />
Console.WriteLine ("Finished - File " + movie_source + " is converted to " + movie_dest );<br />
Application.Exit ();<br />
}<br />
What should i do ? should i do the shellexe or something else .
in sdk they write the following
Instead of including the wmencode.h and mspropshell.h header files, you can import the corresponding type libraries to generate wrapper classes that simplify implementation of the related COM interfaces:
#import "WMEnc.exe"
#import "MSPShell.dll"
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Call a function like this instead:
void DoEvents()
{
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
if(PreTranslateMessage(&msg) == FALSE) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Its give me the error for
kakan wrote: if(PreTranslateMessage(&msg) == FALSE) {
message actually this thing. I must write in the dll part and it is all apart from the window programming.So how can i resolve the error?
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
What error go you get?
What's the error message?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Error 59 error C3861: 'PreTranslateMessage': identifier not found d:\amit\projects\encoderplugin\encoder.cpp 2881
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
PreTranslateMessage is a MFC func.
Check this[^] for a non MFC version.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Are yaar i reading the same thing.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
amitmistry_petlad wrote: Are yaar i reading the same thing.
Sorry, I don't understand. Can you rephrase your reply?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I mean when you send me the link at the same time I was look at the same link.
so I am just surprised
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
OK, then I understand. Thanks for Nish.
Then your problem ought to be solved?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
|
Hi,
If CSemaphore::Release() is called multiple times by the same thread, does it increase the count each time, or does CSemaphore only keep a count of the number of DIFFERENT threads that have called Release?
I am working on some code where one thread calls Release() each time it adds stuff to a queue, expecting a worker thread to fire the correct number of times to remove stuff from the queue. The code doesnt work properly and I suspect it is fundamentally flawed.
Any ideas?
Tony
|
|
|
|
|
softwaremonkey wrote: If CSemaphore::Release() is called multiple times by the same thread, does it increase the count each time
Yes, absolutely.
Unless there's something wrong with the CSemaphore class since a semaphore is supposed to work that way.
softwaremonkey wrote: I am working on some code where one thread calls Release() each time it adds stuff to a queue, expecting a worker thread to fire the correct number of times to remove stuff from the queue. The code doesnt work properly and I suspect it is fundamentally flawed.
This is a commonly used technique that is both efficient and a school book example of good asynchronous design. About the "fundamentally flawed" part I can assure you that it's not, at least not in the aspect of design.
However, I don't use the CSemaphore class. I favour to use ::CreateSemaphore(...) , ::ReleaseSemaphore(...) and ::CloseHandle(...) .
Can you explain more about the code where you push and pop your object to the queue and how you wait on the semaphore? How about some small code snippets, preferrably within <pre> tags...
You can also read about it here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I agree with Roger 100%. Using a semaphore this way is very efficient.
The only thing additional that comes to mind (that you may/probably have considered) is the
possibility of reaching the maximum count on the semaphore object. This needs to be addressed
when calling ReleaseSemaphore, otherwise you could (depending on the worker thread
implementation) end up with queued data that the worker thread will never know about.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|