|
Why this much since there is a simple solution available?
- NS -
|
|
|
|
|
i do understand that CComboBox::Dir works. but it working only for the current working directory.. i wnat to list out the total number of directories available on the system.
|
|
|
|
|
ya.For that only i have used the above code even though it is little bit lengthy.But it works perfectly.
|
|
|
|
|
But it is only for getting the drives, not directories. Am I right?
- NS -
|
|
|
|
|
ok.. will try that.. but u will have to tell me where to put that piece of code.
|
|
|
|
|
Chandrasekharanp wrote: but it working only for the current working directory..
That's wrong. Try this...
m_combo.Dir( DDL_EXCLUSIVE | DDL_DIRECTORY, "C:\\Windows\\*.*" );
Chandrasekharanp wrote: i wnat to list out the total number of directories available on the system.
For this case, AFAIK, you have to enumerate the directories. CFileFind class can help you.
- NS -
|
|
|
|
|
nothing is getting displayed in the combo box if i put the piece of code which u gave me.
|
|
|
|
|
That is awesome... that is a test code.
Anyway can you please show me the code segment? I need to know where and how you used it.
- NS -
|
|
|
|
|
it is working. but it is giving all the files and directories that is available in C. my requirment is not that. for example if there are 4 drives..ie(A,C,D,E). i need to print that A.C.D.E in the combo box. nothing else.
|
|
|
|
|
What I gave you is only an example. You can call it for any drive. Each call will add the list of directories to the existing list in the combo. If you need to get all the directories, as I said earlier, use CFileFind class recursively.
If you need only drives, specify the attribute as DDL_DIRECTORY.
- NS -
|
|
|
|
|
NS17 wrote: If you need only drives, specify the attribute as DDL_DIRECTORY.
Wrong. You should use DDL_DRIVES if what you want are drives.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: You should use DDL_DRIVES
Ooops... That's what I intended... Sorry for my careless typing (copy-pasting).
- NS -
|
|
|
|
|
Chandrasekharanp wrote: i need to print that A.C.D.E in the combo box.
These are drive designators, not directories (as your subject implies).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Send it a CB_DIR message. Use DDL_DIRECTORY | DDL_EXCLUSIVE for the WPARAM argument. If you are using MFC, the solution is even simpler.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
yes i am using MFC. how will i do it in MFC??
|
|
|
|
|
Did you overlook this?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Can we get the starting date from which history of IE is displayed in the history folder programatically.
|
|
|
|
|
FindFirstUrlCacheEntryEx/FindNextUrlCacheEntryEx specify URLHISTORY_CACHE_ENTRY, you'll have to check every entry and examine the times in the INTERNET_CACHE_ENTRY_INFO to find the earliest time.
|
|
|
|
|
Hi,
How to identify the already created application is SDI/MDI/Dialog based.
Thanks in advance
|
|
|
|
|
shir_k wrote: How to identify the already created application is SDI/MDI/Dialog based.
An option could be to check main window class using GetClassName.
AfxGetMainWnd()->GetClassName()...
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Hi,
I've used the CTaskbarNotifier (found here) class in my project to show taskbar notifications. It works fine on Windows XP, but I've just seen that it's not so fine on Vista... The notifications have an ugly border.
You can see it on screenshots:
XP: http://alaf.sierp.net/xp.jpg
Vista: http://alaf.sierp.net/vista.jpg
Any idea how to get rid of that border?
Cheers,
Maciej
-- modified at 8:46 Monday 15th October, 2007
To be more specific:
The windows is created with the WS_POPUP style:
CreateEx(0,strWndClass,NULL,WS_POPUP,0,0,0,0,pWndParent->m_hWnd,NULL);
One thing comes to my mind, I don't have the Platform SDK for Vista, I am using the previous one, for Windows XP. Could the lack of Vista SDK be causing incorrect styling?
|
|
|
|
|
This is not really language specific but more of a source code parsing.
I have a large ASP source file that I like to split up, resulting in separate ASP files, each containing one function and the filename named after that function.
Does anyone know of a tool/script which does this?
PS: I am too lazy to learn Perl/AWK/Python to do this, hence why I believe someone has already written a tool/script to do this. Possibly in C++/etc.
|
|
|
|
|
Hi,
I'm reading documentation about Libraries and how to load, detach them. But I have some concept doubts about.
I have a point in my program where I have to use some functions that should be programmed in a Dll to avoid having that functions in computers where we have not delivered this dll. So when needed, the user should click on a button and search the dll. If the dll is there, then I save the returned name/path of the CFileDialog and set a variable like "m_bLibraryLoadedOK". Afterwards, when the other button is pressed and depending on that bool, I give an error message or use the LoadLibrary function with the saved name/path, use the function I will have in the DLL, and when all is ready... I want to unload the library.
And it now is where I have the doubts.
For example I don't correctly understand the bold part in the following quote: "The Visual C++ compiler supports a syntax that enables you to declare thread-local variables: _declspec(thread). If you use this syntax in a DLL, you will not be able to load the DLL explicitly using LoadLibrary or LoadLibraryEx. If your DLL will be loaded explicitly, you must use the thread local storage functions instead of _declspec(thread)."
The function in the dll is going to need just one variable from my main programm, a pointer/reference to a buffer with the data that have to be written in the PLC. All the other things (if needed) will be local. Should I worry about the quote above? What „key words“ should I look for?
And…
When I load the dll. Is a thread being automatically created? Will the FreeLibrary enough at the end of my function to unload the library? Or will I have to use more things (Like the DLLMain )??
Any tip or Keyword to look for and help me undertand the thema will be apreciated.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: When I load the dll. Is a thread being automatically created?
No. You can load and call functions in a Dll on the same single main thread of your program. Use of Dlls doesn't require multiple or secondary threads, it's just function calls.
Nelek wrote: Will the FreeLibrary enough at the end of my function to unload the library?
Yes. You can't gaurentee Windows will actually unload it, Windows is lazy but it makes no difference, you can treat it as having been unloaded.
Nelek wrote: Should I worry about the quote above?
No. Not in this case. It only affects variables declared in the Dll with __declspec(thread) where the Dll doesn't have it's own statically linked copy of the C Library, i.e. it isn't already linked with LIBCMT or one of ts variants before you use it.
The explanation of this is that __declspec(thread) inserts an entry in a special data table that is used by the C Library startup routines to setup up Thread Local Storage variables. If the C Library startup doesn't run after your Dll is loaded because it dones't have it's C Library instance then this initialisation never happens and your __declspec(thread) variables are invalid.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thank you for the good answer.
The code to read is already working in my program. I just have to code it in the dll and make the loading dinamically. With your answer and two articles I found in the site, I am not so afraid about doing it.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|