|
Hi,
Im writing a program in C++, using the windows.h header file to develop an application. Im capturing images from a camera and then saving them in a default folder.
I want to allow the user to be able to browse through their file directories and choose which folder they want the images to be saved to. But, I cant find a simple solution. I would have thought there would have been a defualt control that allowed you to do this. But all the ones I have seen require you to set imagelists and things for the bitmaps to use for the folders.
I would GREATLY appreciate any help with this problem. Ive looked around on msdn, and on this site too. What is the easiest way to do it? Apart from simply asking the user to paste the folder path into a text box.
Cheers for any help
|
|
|
|
|
rbeat100 wrote:
I want to allow the user to be able to browse through their file directories and choose which folder they want the images to be saved to.
Look up SHBrowseForFolder() in MSDN Library
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
ShBrowseForFolder is what you are looking for, search around codeproject for samples, and/or how-to.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Thanks to you both for the quick responce
Ill give it a try.
|
|
|
|
|
try this code:
BOOL BrowseForDir(char *cpPathName, HWND hParent)
{
BOOL bRetval = FALSE;
BROWSEINFO sBI;
memset(&sBI,0,sizeof(BROWSEINFO));
sBI.hwndOwner = hParent;
sBI.pidlRoot = NULL;
sBI.pszDisplayName = cpPathName;
sBI.lpszTitle = "Select the folder To Save To:";
sBI.ulFlags = BIF_RETURNONLYFSDIRS;
sBI.lpfn = NULL;
LPITEMIDLIST pidl = SHBrowseForFolder(&sBI);
if (pidl)
{
SHGetPathFromIDList(pidl,cpPathName);
bRetval = TRUE;
}
return bRetval;
}
|
|
|
|
|
basementman wrote:
try this code:
Do you mean it doesn't work?
Can't try it but here is my code:
BROWSEINFOA bi;
memset(&bi, 0, sizeof(bi));
bi.hwndOwner = this->GetSafeHwnd();
bi.lpszTitle = "Select your dir";
LPITEMIDLIST itemList = SHBrowseForFolder(&bi);
if(!itemList)
return;
char* pathName = new char[1024];
if(!SHGetPathFromIDList(itemList, pathName))
{
::MessageBox(NULL, "AAARRGH!! Invalid path!!!", "Error", MB_OK | MB_ICONERROR);
return;
}
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Hi.
I have two classes derived from CObject. They are leaking memory somehow.
What's wrong?
Memory Leaks!
0 bytes in 0 Free Blocks.
273 bytes in 6 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
268 bytes in 3 Client Blocks.
Largest number used: 3260 bytes.
Total allocations: 4732 bytes.
EXPLORER.DLL Terminating!
DLG.DLL Terminating!
WEB.DLL Terminating!
The thread 0xEB4 has exited with code 0 (0x0).
<br />
<br />
class CModulExplorer : public CObject<br />
{<br />
DECLARE_SERIAL(CModulExplorer)<br />
public:<br />
CModulExplorer();<br />
virtual ~CModulExplorer();<br />
virtual void Serialize(CArchive& ar);<br />
<br />
HICON hSIcon;<br />
HICON hLIcon;<br />
BOOL bSystemFolder;<br />
CString sDefaultName;<br />
CString sNodeName;<br />
CString sPath;<br />
};<br />
<br />
class CModulWeb : public CObject<br />
{ <br />
DECLARE_SERIAL(CModulWeb)<br />
public: <br />
CModulWeb();<br />
virtual ~CModulWeb();<br />
virtual void Serialize(CArchive& ar);<br />
<br />
enum NavigationStyle {WNS_BLANK = 1014, WNS_LAST = 1015, WNS_DEFAULT = 1016};<br />
<br />
HICON hSIcon;<br />
HICON hLIcon;<br />
NavigationStyle ns;<br />
CString sDefaultName;<br />
CString sUrl;<br />
CString sNodeName;<br />
};<br />
<br />
class CMainFrame : public CMDIFrameWnd<br />
{<br />
DECLARE_DYNAMIC(CMainFrame)<br />
public:<br />
CMainFrame();<br />
<br />
public:<br />
CModulExplorer *m_pExplorerCls;<br />
CModulWeb *m_pWebCls;<br />
...<br />
}<br />
<br />
<br />
<br />
IMPLEMENT_SERIAL(CModulExplorer, CObject, 0)<br />
IMPLEMENT_SERIAL(CModulWeb, CObject, 0)<br />
<br />
<br />
CModulExplorer::CModulExplorer()<br />
{<br />
}<br />
<br />
CModulExplorer::~CModulExplorer()<br />
{<br />
}<br />
<br />
void CModulExplorer::Serialize(CArchive& ar)<br />
{<br />
}<br />
<br />
<br />
CModulWeb::CModulWeb()<br />
{<br />
}<br />
<br />
CModulWeb::~CModulWeb()<br />
{<br />
}<br />
<br />
void CModulWeb::Serialize(CArchive& ar)<br />
{<br />
}<br />
<br />
<br />
CMainFrame::CMainFrame()<br />
{<br />
CRuntimeClass* pClass = NULL;<br />
<br />
pClass = RUNTIME_CLASS(CModulExplorer);<br />
m_pExplorerCls = (CModulExplorer*)pClass->CreateObject();<br />
<br />
pClass = RUNTIME_CLASS(CModulWeb);<br />
m_pWebCls = (CModulWeb*)pClass->CreateObject(); <br />
}<br />
<br />
CMainFrame::~CMainFrame()<br />
{<br />
delete m_pExplorerCls;<br />
delete m_pWebCls;<br />
}<br />
|
|
|
|
|
I have found that some ADO methods (Update, Delete)
doesn't work with tables having high number of fields.
Is this problem real ??
How can I manage big tables with ADO ?
Tanks a lot !
|
|
|
|
|
Huh!?
Can't be...
What error do you get? Or what doesn't work exactly?
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
The 80004005 error is generated and the string in the exception is: "Query too complex"
This assertion is generated when I try to update an
existing record or to remove it.
Instead, when I try to add a new record and when I fill
it, or when I browse the big table, none exception is
generated !!!
I really don't know how to solve this problem !!!
|
|
|
|
|
Hm... don't know what i9t can be...
Are you sure that your SQL query is correct?
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Rickard is right. You usually get this error when your SQL statement is wrong but you say that this doesn't happen when you add a new record, so there could be some other reasons. For instance:
1. Make table names and column names shorter.
2. Reduce the number of columns in the table.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Hi,
I have two (or more) sets of icons that I want to use together to form a combination of icons. My icons have transparency, so I want to be able to draw one on top of the other, so that the one on the bottom shows through the transparent areas of the top.
Btw, I want to be able to draw this on any dialog.
Thanks in advance.
|
|
|
|
|
See DrawIcon or DrawIconEx in the doc.
|
|
|
|
|
I have a problem using the WST utility.
I followed all the steps in creation of the exe and linking the wst.lib file to the linker.
i have my .wsp generated files in the c:\wst dir
but the moment i run the command
c:\wst:> wstune /o myfile.wsp
it gives me an error
wstune : using "myfile.wsp"
what could be the problem
can anyone give me the solution.
thanking you
|
|
|
|
|
Hy everybody!
a little question...
I'm creating a invisible window (with create function), but when I do it my current app window loses his focus...
How can I create the window in the way that my current window don't loses his focus?
thanks all!
Cheers!
Ricky
|
|
|
|
|
One solution is to simply focus the parent window right after calling creating the child window.
kuphryn
|
|
|
|
|
For example I have a dialog based project with tab control.
And there is some amount of dialog resources.
When I change tabs I need to include (embed) and switch those dialogs inside the main dialog.
I dig into ICQ dlls and found that they are using the same trick in dialog with tabs.
|
|
|
|
|
If it is possible use the property sheet, it's easier to maintain and to work with...
|
|
|
|
|
|
Hey all,
I'm working on a project and need to better understand and restrictions Microsoft has on the redistribution of these DLLs. As I understand it, they ship as part of W2K, but work on 98/ME as well. There are a few technical articles that outline how to use them for enumerating network adaptors and completing other SNMP tasks, but I can't find anything about restrictions on their use.
Anyone have any experience with them?
WSNMP32.DLL
MGMTAPI.DLL
MIB.BIN
David
|
|
|
|
|
The windows 98 resource kit has an install for the MS SNMP Agent buried in here[^]
There is an snmpzp.exe file available here[^] for win95.
Also check KB139462.
|
|
|
|
|
Does anyone know anything about the UNZDLL.DLL? I am trying to find a way to extract archived .zip, .tgz, .tar files from within my application. There are dozens of commercial tools for this, all at a reasonable price (I guess). I just want to make sure that I'm not missing something obvious / easy before I go buying something.
I also found some MFC source that wraps the UNZDLL.DLL exported functions.
Thanks,
Dave
|
|
|
|
|
|
Help!
I create a propertysheet on a view. when the program runs the sheet show at once. I want to change the size of the propertysheet.
But I fail. Please help!
Your help are greatly appreciated.
davidwu
|
|
|
|