|
I'm working on an application in which I need the user to be able to select a folder path on their computer without selecting a file. This path could then be used for outputting multiple files to the same user-specified location.
Does MSVC++ include a dialog class appropriate for selecting a folder?
|
|
|
|
|
Look up SHBrowseForFolder[^] on MSDN but I'm sure you'll find nicer implementations here on CP.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
I see! Hmm... that should work.
Okay, so if I do it like this...
BROWSEINFO info;<br />
LPITEMIDLIST pList;<br />
char buffer[MAX_PATH];<br />
<br />
info.hwndOwner = GetSafeHwnd();<br />
info.pidlRoot = NULL;<br />
info.pszDisplayName = buffer;<br />
info.lpszTitle = "Select Output Folder";<br />
info.ulFlags = BIF_EDITBOX | BIF_VALIDATE | BIF_STATUSTEXT;<br />
info.lpfn = NULL;<br />
<br />
pList = SHBrowseForFolder(&info);<br />
if(pList == NULL) return;
How do I get the selected path out of the ITEMIDLIST and into a char * or CString?
|
|
|
|
|
char szPath[MAX_PATH];<br />
SHGetPathFromIDList(pList, szPath);
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
I think that might be the last piece of the puzzle I needed to complete my application. Thank you, Alvaro. I appreciate your help very much!
|
|
|
|
|
Howdy,
I'm working on a project that includes a windows client program. I did a prototype that was basically an MFC SDI application that hosted IE with CHtmlview. I displayed HTML pages with controls, and processed the POST results. I also had some functionality in the toolbar and menus.
It really worked well and I was happy with it. I demoed it to the PHB's and they liked it, but thought the "square" MFC window was "dull and boring".
They now want me to keep the same web browser based GUI, but instead of hosting IE in a "boring" MFC window, they want it inside of a sexy bitmap of arbitary shape.
They want something"theme-able" like Winamp, so that an artist can draw the GUI and I can add the fuctionality. One of them really likes the Roxio CD burner GUI as an example. They need this client to be fairly small, they don't want to do it in Macromedia Flash if we can do it C++.
I'm sure there is a C++ application framework out there that supports themes. Can any of ya'll post a pointer or a suggestion?
thanks
Jim
|
|
|
|
|
If you search for 'skinnable' on CP, there is an example, although not with windows of arbitrary shape. I've not used it so I dunno how good it is.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hello,
This maybe a vague question but I figure I'll ask it anyway.. I have a UI thread that gets spawned from my app.. when I close the app I see a memory leak and it points to this...
IMPLEMENT_DYNCREATE(CConnectThread, CWinThread) <--------
Why is that? I close the UI thread from with in it's self by issuing a AfxEndThread(0,TRUE);
Weird.. any ideas?
Rob
|
|
|
|
|
According to the docs for "Normal Thread Termination"
"For a user-interface thread, the process is just as simple: from within the user-interface thread, call PostQuitMessage in the Platform SDK. The only parameter that PostQuitMessage takes is the exit code of the thread. As for worker threads, 0 typically signifies successful completion."
Hope that helps.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Thanks for the reply.. I have tried to use PostQuitMessage.. But I am unsure how to obtain the exit code.. Can you give me a hint
Thanks,
Rob
|
|
|
|
|
RobJones wrote:
Thanks for the reply.. I have tried to use PostQuitMessage.. But I am unsure how to obtain the exit code.. Can you give me a hint
I'm afraid I don't know the answer to this. I would have thought MS would have examples on their site. Do a search there for UI Threads and alike.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Did some research and the exit code would be the same code you would use in WM_CLOSE (wParam) which is usually 0... I went ahead and replaced my AfxEndThread with PostQuitMessage(0) and everything seems to be working fine.. (I'm not seeing any memory leaks..)
Thanks again!
Rob
|
|
|
|
|
One hint coming up:
GetExitCodeThread[^]
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Thanks,
Rob
|
|
|
|
|
Hi,
I'm developing an application using the Doc/view. I have several different views of the document which I want to display. This is being acheived by using, surprise, static splitter windows. the catch is that I need to be able to change the configuration of the splitter windows depending on what the user wants. For example:
splitter 1
-----------------
- view 1 -
-----------------
- view 2 -
-----------------
But now the user wants to see another view like this:
-----------------
- view 1 -
-----------------
- view2 - view3 -
-----------------
I know how to set up views, but my problem is how do I destroy these views and re-create them in the new format that I need to? I tried to change the number of rows/columns then re-create the views, but I can't add any more rows or columns once the first splitter is created, but I can't figure out how to delete that original splitter and then re-create the whole package. Any ideas?
|
|
|
|
|
|
hi everybody!
Is there any functions in ODBC or any other library that dealing with adding escape characters to the sql input string that contains single quote characters? btw, i'm using msaccess database with my vc++ program.. do you use single quote or escape character to escape the single quote in the sql input string?
e.g.
original sql string: insert into table1(test) values('it's here')
after adding the escape character: insert into table1(test) values('it''s here')
|
|
|
|
|
Good day!
I have a crash in release when changing tab in the CTabCtrl.
and while writing the message, that I mostly delete, I fixed it ...
Anyway, for those who want to know ...
I had this :
ON_NOTIFY(TCN_SELCHANGE, IDC_TABCONTROLLER, OnTabSelChange)
and I had this :
void MyPanelParent::OnTabSelChange( )
{
}
but the real definition is :
void MyPanelParent::OnTabSelChange(NMHDR* pNMHDR, LRESULT* pResult)
{
}
Anyway, all is well now, move along ...
Max.
|
|
|
|
|
Years later i have come down to this stupid problem, thanks you saved me from many lost hours more.
|
|
|
|
|
How can I dissect an .exe to view its contents? The IDE of Visual C++.NET does not allow these file types to be opened. I opened one using the edit program from the dos command prompt, but it was just a bunch of symbols and letters. So I guess my question should be what do I do to view an .exe in a legible form?
|
|
|
|
|
What do you want to view specifically?
You can view things like the import and export tables, the resources and other information like that with a PE viewer. You can find one in MSDN by Matt Peitrek.
However, if you want to look at the actual code for the EXE you cant do that. You will need a reverse compiler, and they are not all that great.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Paul Watt wrote:
You will need a reverse compiler, and they are not all that great.
Nor are they all that legal in some areas. However I'm guessing Mr Anonymous doesn't care since he wants to steal someone's code.
|
|
|
|
|
Mark Nischalke wrote:
However I'm guessing Mr Anonymous doesn't care since he wants to steal someone's code.
Yeah, but what would he do with it ? He's obviously dumb enough to expect an exe just to be all the source files joined together.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Why does Mr. Anonymous have to be trying to steal someone's code. Why can't he just be learning through example. Or maybe he wanted to see how wrappers are utilized. There are hundreds of possibilities, but it would take a critic to only see the negative ones.
|
|
|
|
|
The IDE does let you open an EXE to view it's resources, at least.
Software Zen: delete this;
|
|
|
|