Yes I did, even though that is the default in VB. I even tried some slight of hand, by changing the prototype slightly and passing the actual pointer via VarPtr(), but it made no difference in the result. What bothers me is that I had to pass ClassGuid to the SetupDiClassGuidsFromNameA function inorder to fill the GUID structure and it succedes every time. I can even use the various slight of hand modifications, I tried with SetupDiGetClassDevs, on SetupDiClassGuidsFromNameA and it still succedes.
Any way I think the guys on the VB forum may be able to help. I've been ask to post the code, and I will be doing that there on monday (since I do not have it here).
Mean while I just wrapped it up in an ATL COM object (ActiveX control), so that I could consentrate on other details for awhile.
F.Y.I. I found a free program on the www called ApiViewer.exe (ApiViewer 2004) that produces declarations for almost every thing, unlike the viewer that comes with VB. Although you need to verify that they are correct yourself, since the prototype for SetupDiGetClassDevs was incorrect (no return value specified).
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
I would also read Michael Dunn[^]'s other shell articles. I have them saved to my
PC, and they're a better resource than the platform SDK! I have plagiarisedused
them extensively for my own shell toys.
I am writing an AutoRun.exe for my CDs/DVDs. I am not that familiar with C++/VC++ environments. How can I reference "SYSTEM32.DLL" and use function "GetPrivateProfileString()"? Prefer in C++/VC++ 7 & Unmanaged Code.
I am trying to avoid .NET FrameWork dependencies because not every machine loaded with .NET FrameWork. Any input is greatly appeciated. Wish you a happy & thriving 2005.
i am recently working on a project using DirectX 8.1 and VC++.NET. I need to develop the program under fullscreen mode. Then i realize i need to add a printing function, to call the printers connected and print some documents and pictures in the program. I have some knowledge on how to do it using MFC, but not under the circumstance i described above.
So i welcome the nice gentlemen who know this trick enlighten me abit. thank you very much in advance.
The man of tomorrow is shaped by his battles today.
Thanks for your answer. Two more questions...:
1) I'm trying to define a non static valarray member, stores 15 elements of type double, but without success. All help i found defines valarrays within main(). I tried the same definitions for my class but dose not work. Actually i tried:
With this the compiler is ok, but when i tryied to asing values to m_array with  operator, program crashes (actually this is logical because the m_array is of size 1, i think...).
VC++ 2003 comliler generates the following error :
error C2059: syntax error : 'constant'
2) The valarray allocates memory dynamically on the heap or statically? So if i want a huge valarray (say 10000 elements) is this ok:
or i have to allocate the valarray dynamically using a pointer?
This code is simply copying a file 1.txt to a folder named aa present at C root. After I do this and I try to delete folder aa(while my application is still running), it lets me delete it and that's OK. Now have a look at the problem code:
Now, if I select the same folder in CFileDialog and create a file there, it copies it quite well thru CopyFile function. The problem is that If I try to delete folder aa now (with my application still open), it wont let me delete it although I can delete the newly created file inside this folder but deletion of folder is not possible. It gives an error message saying that this folder is in use by some other program.
Am I doing something wrong or is it a bug in CFileDialog. I think it is a bug. Looks like CFileDialog is not releasing the handle of the folder. What is your opinion.
I hated going to weddings. All the grandmas would poke me saying "You're next". They stopped that when I started doing it to them at funerals. My Articles
Sometimes CFileDialog will switch directories.
You can call GetCurrentDirectory to see if it has switched to the directory the first file is in (the file you can not delete).
Also, I think it has a slow release cache built into the dialog or some code it utilitizes. If you were to wait a moment, you would find you might be able to delete the files. I say this because, if you watch your debug output after calling a CFileDialog, you will notice information about a secondary thread you did not directly create that terminates after a few seconds. This might be where the caching is occurring. I don't know how to force it to flush immediately.
I think it is a 'design feature' of CFileDialog that can sometimes get in your way.