|
CFileDialog is used to get a filename. But I need to get a folder where I will copy file to, what should I do? Thank you.
|
|
|
|
|
you can use the SHBrowseForFolder function.
lookup it in MSDN for detail.
|
|
|
|
|
|
Hi All,
I need to enable the Password meets required complexity option within the password policy of windows 2000 programmatically. Is there any API available to do this programmatically.I also want to change the default configuration provided by the Windows 2000 to suite my needs.For that I have developed a password filter dll but am unable to use it correctly.Can anybody guide me in how the settings are to be made.
Kindly help me if anybody knows this.
Thanks
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
Help, I'm a bit lost creating my very own static library.
I've created a .lib with one header file and one source file. It contains only one function (for testing). The header file includes windows.h and stdio.h , mainly for things like LPCTSTR which I want to add later on.
The header file has the #if !defined ... #define declared so redefinition is out of the question.
Now, when I want to use this library in another application, I've got to include the library's header file. The library itself is added through add to project -> files... in the project menu of vc++. So far, so good.
Trying to compile the testapp, results in these linker errors. Why?
Linking...
LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCRTD.dll)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in LIBCD.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/DownloadTest.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
|
|
|
|
|
You need to have either anything as debug or anything as release. Same is for multithreaded and singlethreaded.
Check your application project settings: the 'Debug' configuration HAS TO link against a 'Debug'-version of your lib, and the 'Release' HAS TOuse a 'Release'-lib.
Likewise for 'singlethreaded' vs. 'multithreaded'. So you may end up with 4 differing configurations for your project.
|
|
|
|
|
Everything is debug.
And for the single-multithread, I've never messed with them so it's not very likely going to be that...
I've left this out of the library source file, cause it didn't compile otherwise.
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
But then, if we compile both as release, the errors are still there.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
|
|
|
|
|
Oops...
Forgot to mention that the app is mfc. Now I've selected mcf-dynamicaly instead of no mfc in the library config, although the library itself does NOT use mfc.
it works
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
|
|
|
|
|
Does anybody know how to read count of the sections in INI file and them names?
Thanks.
==============
wasp.elcat.kg
|
|
|
|
|
Try this: http://www.codeproject.com/cpp/cinifile.asp
One more tip, if you have this kind of Qs, try first in this sites search engine, almost always you'll find your answers there + source code + examples. It never failed me before...;)
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
Can you read?
I need numbers and names of the INI.
I can't find the way to do it with your class.
|
|
|
|
|
GetPrivateProfileSection();
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
Man, I'm only trying to help, don't get hostile...
Well, another idea, try to open the INI not using registry function (FILE, CFile, istream* ...). Read lines, one by one and look for '[' and ']' (use strtok , or something).
Locate them and cout. That's about it.
Notify me if works(or not).
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
Jeez, I heard the slap all the way over here. You alright?
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
Are you from out of the country?
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
Oh .. sorry ..
I'll tryed to parse file as you said ... it works well.
Thanks.
|
|
|
|
|
GetPrivateProfileSection() works better? If so, silly me... I'm always trying to invent the wheel
I'm so high...
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
I have written a class in a seperate file which I want access to the statusbar. How do I change the message in the statusbar from this class? I have included the "stdafx.h" in the class I defined.
|
|
|
|
|
If what you want is a value being displayed in the status bar (like coordiantes in a picture-editor), try this:
You set a variable in your CDocument class.
This variable is then displayed via a ON_COMMAND_UPDATE_UI-handler in either your main frame or your view.
|
|
|
|
|
Thanks for your reply, jhwurmbach!
I think I have to repharase my question. I have written a class method which does all the screen output, but the output is onto the screen via "cout". Now, I am trying to rewrite this class such that I could output my message onto the statusbar in windows instead. I understand that "CView" is the one that handles the output in windows. I am trying to change my original DOS-output class to a windows-output class one. I hope u can understand what I am trying to say. U have any suggestion?
|
|
|
|
|
You don't want to simplay have a 'logging' style output in a Window (for that, try searching the site), you want to show one output line in the status bar, right?
Do we talk about the same 'StatusBar'-thing?
I talk about he same bar that in IE contains the little globe and the 'Internet' text at the right bottom of the window. in the same bar, with SSE-connection, a little yellow lock shows up.
So, probably it is really easiest to let your class-method set a variable in the dochument and show that variable via ON_UPDTE_COMMNAND_UI.
|
|
|
|
|
AfxGetMainWnd()->SetMessageText();
...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]
|
|
|
|
|
Thanks for your reply. I have tried to use that statement u mention. It can't work, apparently SetMessageText is not a member of AfxGetMainWnd().
|
|
|
|
|
I have a VB dll, and a VC client. In this snippet of code from the client :
BOOL _CRemoteCall::MoveProgressBarX(long hPBHWND, long iMin, long iMax)
{
BOOL result;
static BYTE parms[] =
VTS_I4 VTS_I4 VTS_I4;
InvokeHelper(0x60030002, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms,
hPBHWND, iMin, iMax);
return result;
}
how do I get that number 0x600.....? I think what the call does is it calls a particular function from the VB dll, but I just cant figure how out to get that number. Also I hope this number isnt machine specific (just cant be because its hardcoded...)
Thanks,
ns
|
|
|
|