|
1. In the checkbox's 'OnClick' handler, enable/disable the combo-boxes.
2. If you're using WTL, check out this article[^].
|
|
|
|
|
I made this button thats supposed to open an choose folder window then the user will choose a folder or create a folder where the files will be saved then the address of the folder after the user chooses will be put into a text box.
Any ideas how to do that?
Thanks
|
|
|
|
|
If you're using WTL, then you want CFolderDialog - see Michael Dunn's excellent article[^].
Otherwise, You need SHBrowseForFolder[^] for the whole choosing/creating a folder thing. I'll give you 10 extra bonus points if you can get it to start up displaying a folder of your choice (hint: you need to register a callback in the lpfn member of the structure whose address you pass as a parameter, and that callback needs to respond to BFFM_INITIALIZED by sending the BFFM_SETSELECTION with the folder).
Oh, and retrieving the folder that was selected? Yeah, you'll need to get friendly with PIDL s.
Alternatively, you could use the nice, easy to use wrapper for SHBrowseForFolder from this CP article[^]. Might be a little easier than using SHBrowseForFolder yourself.
|
|
|
|
|
Now i am having trouble with this:
BufferSize = TOTALBYTES;
PPERF_DATA_BLOCK PerfData = (PPERF_DATA_BLOCK) malloc( BufferSize );
Size = BufferSize;
dwRet = RegQueryValueEx(Regentry, _T("DownloadPath"), NULL, &Type, reinterpret_cast<LPBYTE>(DownloadPath), &Size);
while( dwRet == ERROR_MORE_DATA )
{
BufferSize += BYTEINCREMENT;
PerfData = (PPERF_DATA_BLOCK) realloc( PerfData, BufferSize );
Size = BufferSize;
dwRet = RegQueryValueEx(Regentry, _T("DownloadPath"), NULL, &Type, reinterpret_cast<LPBYTE>(DownloadPath), &Size);
}
if( dwRet == ERROR_SUCCESS )
{
Path = DownloadPath;
}
else if ( dwRet == ERROR_FILE_NOT_FOUND )
{
if (RegSetValueEx(Regentry,
_T("DownloadPath"),
0,
REG_SZ,
(LPBYTE) &dwData,
(DWORD) (lstrlen(Path.c_str())+1)*sizeof(TCHAR)))
{
printf("Could not set the DownloadPath.");
RegCloseKey(Regentry);
return 0;
}
}
else
{
printf("Could not set the DownloadPath.");
RegCloseKey(Regentry);
return 0;
}
I am getting 'PPERF_DATA_BLOCK' : undeclared identifier, what can I do for that? What do I need to include?
These are my headers:
#include <atlapp.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include <atlctrlw.h>
#include <atlwin.h>
#include <iostream>
#include <atlmisc.h>
#include <malloc.h>
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#include <string.h>
|
|
|
|
|
Looking at PERF_DATA_BLOCK in MSDN, it says 'Header: Declared in Winperf.h; include Windows.h.'.
You have included Windows.h, which makes me suspect there's a macro getting in the way. Looking at Windows.h, it won't include WinPerf.h if the macro WIN32_LEAN_AND_MEAN is defined - I seem to remember that an auto-generated stdafx.h does define WIN32_LEAN_AND_MEAN . Check for that.
PS - I compiled this code successfully (just these two lines) using the command-line C++ compiler, which says that there must be something in your setup or software that's stopping PPERF_DATA_BLOCK being defined.
#include <Windows.h>
PPERF_DATA_BLOCK p = new PERF_DATA_BLOCK;
|
|
|
|
|
Thanks already done with it.
|
|
|
|
|
Hi EveryOne,
I am savitri.I am new to Com programming.I am doing project on GSM modem to send and receive message.I want to use existing dll file for example(comdlg32.dll).Please tell me how shall i use that in my program.please tell me procedure.
it is urgent.Help me.
Regards,
savitri
|
|
|
|
|
Don't cross-post, this is considered rude !
|
|
|
|
|
hi moonen,
it means..wt i did tell me.
regards
savitri
|
|
|
|
|
savitri wrote: it means..wt i did tell me.
Could you please translate that into english so that I can understand ?
|
|
|
|
|
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Hi Savitri,
Use CoCreateInstance to co-create your component. Once you get the interface pointer, you can call its functions.
Finally, don't forget to release the component after you finish your work.
See the help on CoCreateInstance and Release in MSDN .
|
|
|
|
|
Hoe to retrive the html text box input using IHTMLElemt interface.
|
|
|
|
|
innerText property [^] looks promising. See also [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
The docs says:
Most Boost libraries are header-only
So does it compiles very slow?
And any way to make it fast?
|
|
|
|
|
Boost libraries will slow down compilation, mainly due to the amount of code in the headers and the number of template instantiations needed. To speed it up, include Boost headers into a pre-compiled header. But not Boost.Bind or Boost.Lambda headers, as they use declare some objects that need to be single instance, and putting them in pre-compiled headers can mess that up.
You need to balance the convenience that Boost headers get you against the compile times. It's worth it 99% of the time.
|
|
|
|
|
I can't understand why it is worth. 99% of the time when using boost, I think the document should be enough, is it?
|
|
|
|
|
followait wrote: I can't understand why it is worth. 99% of the time when using boost, I think the document should be enough, is it?
Huh?
Steve
|
|
|
|
|
Thanks for you help.
But I can't agree that header files contains so much implementations code, I think it will slow down the compilation a lot (not sure). Could you tell what's the benifit by doing so?
|
|
|
|
|
I still don't understand what your asking. Boost relies heavily on templates, which can tend to slow down compilation. The solution, as previously mentioned, is to use pre-compiled headers.
Steve
|
|
|
|
|
followait wrote: But I can't agree that header files contains so much implementations code,
Template code *has* to be in headers if you're going to instantiate it for different template parameters, because every time you instantiate, you create a new implementation of the class/function.
|
|
|
|
|
|
If it is, where can I find it?
Thanks.
|
|
|
|
|
Not open as such, but it gets installed with versions of Visual Studio you pay for. In my VS2008 installation, it's in C:\Program Files\Microsoft Visual Studio 9.0\VC\crt\src.
|
|
|
|
|
Actually is should be here (along with other things): "C:\Program Files\Microsoft Visual Studio 9.0\VC\include". The CRT and the STL are two different things.
Steve
|
|
|
|