|
Thanks very much.
It's done, my app is unicode.
|
|
|
|
|
|
I have two strings and I do the following...
string old_path;
string new_path;
rename(old_path_newpath)
Doing this I get the following error. How do I overcome this error.
error C2664: 'rename' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
</char></char,struct>
THANKS
|
|
|
|
|
try :-
rename(old_path.c_str(), new_path.c_str() );
notice the c_str() - that effectively gives you a const char * from the string
Im presuming rename(old_path_newpath) was a typo ..
'g'
|
|
|
|
|
Except this error you can use of SHFileOperation instead rename.
|
|
|
|
|
if he cant figure out how to use a relatively simple API like rename(), do you honestly think he's going to be able to figure out SHFileOperation ?
I dont think so ...
(even I use a wrapper class around SHFileOperation to make it simpler)
'g'
|
|
|
|
|
No my answer was genraly SHFileOperation is better than rename not for solve problem.
|
|
|
|
|
I have both VC++ 3.0 and 5.0.
When I compiled a program wit 6.0 it asked for "MMSYSTEM.LIB".
Does VC++ 6.0 have a "MMSYSTEM.LIB" file? VC++ 3.0 does have the file but it is only for 15 bit applications.
Bob Macklin
Seattle, Wa.
|
|
|
|
|
|
|
With VC++ 5.0 I had to manually point the compiler ti "winmm.lib" when in DEBUG mode. Then the application ran as expected.
But when I ran the compiler in RELEASE mode it bitched because it could not find "MMSYSTEM.LIB". So I copied "WINMM.LIB" to "MMSYSTEM.LIB" and it compiled fine. But the application hung on one of the functions provided by "WINMM.LIB" when executed. The function that hung was "waveInStart()".
So this says the problem is in VC++ 5.0.
I can live with this problem by leaving the app in DEBUG mode.
Thanks for the help.
Bob Macklin
Seattle, Wa.
|
|
|
|
|
You have to point the linker for both configurations (Debug and Release) to "winmm.lib". Copying "WINMM.LIB" to "MMSYSTEM.LIB" does not make sense.
|
|
|
|
|
There is no "mmsystem.lib" shipping with VC6. Maybe you're confusing this with "mmsystem.dll" which is part of Windows?
|
|
|
|
|
I have had this system for 10 years and I have never found out how to modify the link list in the IDE.
|
|
|
|
|
Hello everyone!
It's been a while since I had to bother you guys with such a noob question, but I couldn't find an answer anywhere.
I want to have two MFC dialog windows open at the same time, both usable by the user. I don't mind using threads.
Any hints? Thanks in advance.
Windows Calculator told me I will die at 28.
|
|
|
|
|
You should use Modeless dialog boxes
Mukesh Kumar
Software Engineer
|
|
|
|
|
Hi,
It's called "Modeless Dialog". Search the forum for "how to create Modeless Dialogs".
Anyway here are the steps :
1) Add a "form" by right clicking on the class view
2) Include the header file name of the new form class to the source code where you would like to call the modeless dialog
3) To create and show the modeless dialog you should write a code piece like this:
void CTempDlg::OnButton1()
{
Modeless* modlessDlg = new Modeless(this);
modlessDlg->Create(IDD_MODELESS_DIALOG, NULL);
modlessDlg->ShowWindow(SW_SHOW);
}
|
|
|
|
|
Hah. I was doing this instead:
void CTempDlg::OnButton1()
{
Modeless modlessDlg;
modlessDlg->Create(IDD_MODELESS_DIALOG, NULL);
modlessDlg->ShowWindow(SW_SHOW);
}
The window closed before it could open, I'm guessing because the object got automatically deleted after that function call.
Stupid me. Thanks very much!
Windows Calculator told me I will die at 28.
|
|
|
|
|
If your needs are not so big with the dialogs is ok, but if you need more functionality you can also add classes/forms from CFormView and ataching it to the document, so you have more than one view with the same document. It is more difficult to implement, but that way you have more support to messages that are difficult or can't be called from dialogs. Are you interested in this?
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I have heard that it is possible to change a dialog's caption dynamically. Could someone shjow me how to do this in MFC. I am using a single dialog that works well for two different operations, therefore my need to be able to load up a different caption depending on what part of the program is calling up the dialog.
Could someone provide a code snippet for this please?
A C++ programming language novice, but striving to learn
|
|
|
|
|
|
Thank you very much!
A C++ programming language novice, but striving to learn
|
|
|
|
|
In addition to Led Mike's answer, if you want to change the caption according to where the dialog is called, the best place to make it is in the OnInitDialog () checking where it was called and writing the text you want.
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
|