|
Under normal circumstances,if the second parameter of the InternetOpen is INTERNET_OPEN_TYPE_PRECONFIG ,The function will automatically follow the registry select proxy. The important is automatically.
But in my program, I call InternetSetOption set proxy, and the problem is the internetopen can not automatically follow the registry select proxy any more.
I can change the proxy but .
How can i change it back ? to automatically.
please help , its realy pressing. Thanks.
the code :
InternetSetOption(NULL, INTERNET_OPTION_PROXY, (LPVOID)&oProxyInfo, sizeof(oProxyInfo));
hInternet = InternetOpen(_T("Thanks"), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
|
|
|
|
|
See the note under INTERNET_OPTION_PROXY on this MSDN page[^].
Use the best guess
|
|
|
|
|
Q1. What would be the contents of queue Q after the following code is executed and the following data are entered?
Q = createQueue
Loop (not end of file)
Read number
If (number not 0)
Enqueue (Q, number)
Else
Queuerear (Q , x)
Enqueue( Q , x)
Endif
End loop
Data are – 5, 7, 12, 4, 0, 4, 6, 8, 67, 34, 23, 5, 0, 44, 33, 22, 6, 0
|
|
|
|
|
Q2. Have you read this[^]?
|
|
|
|
|
What do Queuerear() and Enqueue() do?
Think of a queue as a movie-ticket line (i.e., FIFO). The numbers represent people, with 0 being a special person. Do this on paper. What do you get?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Choosing which information that Windows Vista's folder contents displayer is to display for each folder. Please, how, from within a Visual C++ program, can I tell my Windows Vista's folder/directory contents displayer, to display for each file in folder/directory X this: Name, Size, Dimensions, Date modified, and nothing else? (I know how to search through a tree of folders from within a Visual C++ program.)
Or, please what is the web address of the online information page where I can read how to do this?
Earlier today (by British time) I called Windows Vista's folder/directory contents displayer's "search for a file", and in every folder that it looked at, it reset the information display pattern to Name, Folder, Tags, Size, Rating, Dimensions, Date modified. (I have no use for Rating; what are these Tags?; the Folder column is no use except in a search result.) To avoid this, ahould I resort to "the trail and the packhorse again" and write my own folder-tree-searcher?
|
|
|
|
|
The information for what columns to display comes from the subkeys of HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags. You can employ a registry monitor to see how the values behave as you adjust the columns.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
If HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags is a registry entry address, please where in Windows Vista is a registry-scanner/editor?
|
|
|
|
|
Anthony Appleyard wrote: please where in Windows Vista is a registry-scanner/editor? See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I found my computer's regedit and made a shortcut to it and dragged that shortcut onto the desktop.
Using it I found my HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\, but in that subtree "Windows" I found no sub-subtree Shell or Bags. I have Windows Vista.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please, is there anywhere a guide to the registry telling me what its hundreds or thousands of entries are for?
modified 21-Mar-13 12:16pm.
|
|
|
|
|
That key may be Windows 7 specific. Using a registry monitor (which is what I did), you should be able to easily find what key is being modified when you adjust columns in Windows Explorer.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I have downloaded the Process Monitor from
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
but it contains no installation instructions. It comes as a .zip file which contains this .exe:-
Procmon.exe
Should I merely drag Procmon.exe onto some folder and make a shortcut to it and drag that shortcut onto the desktop? Or what?
|
|
|
|
|
Just unzip the three files into their own folder. That's one of the things I've always liked about the tools from SysInternals -- they're all self-contained.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Thanks for the info; I have run Procmon.exe , and filtered it to watching only EXPLORER.exe ; and after wading through reams of event log and trying various options with the filters I get the impression that the information about what information columns are shown for which folder, is not stored in the registry but in some private area that only Explorer.exe knows where it is, or is stored in the register encrypted.
E.g. with Procmon.exe running, filtered to catch all explorer.exe operations, I went into Explorer and reset the display options for a file folder called "harness". But the word "harness" never appeared in the resulting procmon.exe log, even though in procmon.exe's display I displayed all columns.
modified 21-Mar-13 17:19pm.
|
|
|
|
|
Anthony Appleyard wrote: I have run Procmon.exe , and filtered it to watching only EXPLORER.exe ; and after wading through reams of event log... Did you filter the operation to just watch RegSetValue?
Anthony Appleyard wrote: ...or is stored in the register encrypted. It's probably the ColInfo value, which is a REG_BINARY type.
Anthony Appleyard wrote: ...I went into Explorer and reset the display options for a file folder called "harness". But the word "harness" never appeared in the resulting procmon.exe log... I think the folders are referred to using numbers instead.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Is RAII used mainly where the code uses exceptions, or does it apply where you check for errors by looking at return values?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Exceptions and RAII complement each other nicely, but RAII is useful any time you want to acquire a resource and not have to worry about explicitly cleaning it up.
Steve
|
|
|
|
|
In theory you can think of an exception as if it was a "big return" from many functions to the catch part of the nearest try block in your callstack. Both in case of a an exception and a normal return you want to release resources that are on the stack frame of the returning function(s). This is where RAII is very useful, by applying it your code will be more brief/visually pleasing, and it is usually much more invulnerable by later changes. Lets say you find a bug and fix it with an error message and a return - but what happens if you forget to free already allocated resources... With RAII this is usually not a problem.
Again, using exceptions and returning values are two very similar ways to report results (not only errors!!!) to the caller. Its a fact that exceptions are used mostly for error handling, I think this is because error-free execution usually doesn't require "multiple returns". Some examples on exceptions whos purpose is not "error reporting" to the caller: Abort exception in Delphi: a silent exception to escape to the nearest catch block, it's silent because it doesn't log errors or show error message boxes even if you don't catch it. Its an easy way for example to escape from the whole "button press" event handler no matter how deep is the callstack. Anoter example is the SystemExit exception of python. If you call sys.exit(0) it doesn't terminate the interpreter!!! Instead it thorws a SystemExit exception that isnt necessarily an error (especially when you exit with zero).
|
|
|
|
|
Exceptions are generally pretty expensive, much more so than a subroutine return. They are are intended for use in exceptional situations. If you're generating lots if them you're probably misusing them.
Steve
|
|
|
|
|
In our current environment performance is pretty important so we compile our C++ code with exceptions turned off and the coding convention is totally avoiding the use of exceptions. Some say that compiling the code with exception handling can be -5 to -10% in performance depending on the compiler because of the boilerplate code generated. I think -5 to -10% is not so big waste in programs where performance is not extremely critical and in return you get a much cleaner code with exception handling because you don't have to return with some kind of error indicator value and you don't have to check this value after every function call. Unfortunately the use of exceptions in C++ is indeed not as pretty as in some other languages like C# and Java, it has some pitfalls so you have to make your choice whether to use them or not. I found a really nice discussion about this: C++ Exceptions: Pros and Cons[^]
|
|
|
|
|
It's true that stack based exception handling has an overhead even when exceptions are not raised (this isn't true for table based exceptions). That said I was referring to the cost when they are raised too frequently, in particular for non-exceptional cases such as returning values.
Steve
|
|
|
|
|
I suspect most if not all c++ compilers use the table based version, but unfortunately it still has an overhead. Not big, but more than zero. For most C++ programs that is not an issue.
|
|
|
|
|
I was partly wrong in my previous post because I misunderstood "table driven". There is an x86 and an x64 version of the table driven exception handling, the x64 version is working like you said. What I meant is the x86 version that was SEH + tables. We are still on x86.
|
|
|
|
|
Hi all,
For my current project[^] I need to use a function pointer to allow a QueueHandler to execute the task of a QueueObject.
I know about what a function pointer is, no worries I searched the net[^] a bit.
I got one question:
-- Is there a possibility to point towards a function without knowing what it exactly returns, and more important without any knowledge of the count and type of the parameters?
In the end it should be like the delegate I know from the .NET side of multithreading.
Thanks for all suggestions in advance.
[Edit: To the univoter who stroke down this question:
Either explain why you have down-voted or go and die in a f*cking fire you moronic ********]
modified 21-Mar-13 11:55am.
|
|
|
|
|
I don't think you can do this in C/C++. How would you pass the correct parameters if you don't know the type and count, and how would you handle whatever it returns? I guess the only possible way round it would be to send a void* to some memory area containing the required parameters, or use the void func(...) type definition. But you still need to know the input and output types in the code that calls the function.
Use the best guess
|
|
|
|