|
It is not as simple as you'd wish, you'll have to work out your way from what EnumChildWindows does. This function calls repeatedly a callback function provided by you listing all child windows according to their Z order. In your callback you'll have to compare what you're given with the dialogs and use that info to assign them the corresponding Z "number".
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
quite easy if it is.
thx
includeh10
|
|
|
|
|
Its awesome! I'd been popping up clunky messageboxes which sometimes caused me grief while debugging. TRACE is just too cool. I'm sure theres a lot of debugging tricks one can employ with TRACE.
ns
|
|
|
|
|
Kewl! Don't forget to also use ASSERT liberally!
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
And if you're ever not using MFC, you can use OutputDebugStr anywhere you like.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Year, thats the really cool thing. (I usually do not use MFC...)
However, I liked the printf-style comfort of TRACE, so I wrote this small wrapper around OutputDebugString and use it quite frequently:
int DBGMSG( LPCSTR pszFormat, ... )
{
char szBuffer[ 1024 ];
va_list Params;
va_start( Params, pszFormat );
int cchWritten = vsprintf( szBuffer, pszFormat, Params );
OutputDebugString( szBuffer );
return cchWritten;
}
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
i installed english OS, if i run a software, i.g. NjStar, which supports another language, internet explorer auto knows and displays right languages.
now i have a program (client) which needs to know if user is running NjStar or any similar software, if so, client tells server about this then server side will send right language to user.
what should i do inside client's coding to detect that?
thx
includeh10
|
|
|
|
|
If I have a char* abc and CString xyz, it is correct to do
xyz = abc? I am not by choice being given char* and I want to make them into CStrings so I can process them comfortably. SO I guess my question is, how do I convert a char* variable into a CString (I dont mean convertthe address stored in the pointer, but store whatevers located at that address ). Please help!!!
Thanks,
ns
|
|
|
|
|
I recommend:
1. CString xyz (abc);
2.
CString xyz;
xyz.Format ("%s", abc);
Best regards,
Alexandru Savescu
|
|
|
|
|
|
Nothing particular about it
Best regards,
Alexandru Savescu
|
|
|
|
|
I'd say (2) is like using microscope as a hammer
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Wow! Thats really cool! Is there a way of going the other way. Like taking a perfectly decent CString and converting into a char* string.(BTW is this correct to say its a char* string?)
Thanks,
ns
|
|
|
|
|
You can do like this:
CString str = "This is my CString";
char* a = new char [str.GetLength () + 1];
strcpy (a, str);
Best regards,
Alexandru Savescu
|
|
|
|
|
That really takes care of a lot of potential problems I am having when I talk MFC to a dll thats working with char* only. My sincere thanks.
ns
|
|
|
|
|
I totally forget how to print the line hello "world" with the quote..
I tried cout<<"hello\"world"\";
another question.. How can i also set
CString str = "hello\"+" world"\"; cout<< str;
so when you print.. hello "world" will print... I want quote to be printed too.
|
|
|
|
|
You need not the +.
Do like this:
CString str = "hello \" world\"";
Best regards,
Alexandru Savescu
|
|
|
|
|
no... i really want to know the way of
<br />
CString str, word;<br />
word = "world!!!";
str = "hello \"\" + word + "\"\";<br />
I tried that way.. but it didn't work.. CString word; could be any string..
may be
hello "BJ"
hello "Sam"
hello "Mike"
|
|
|
|
|
Well, if you cout << str and str is a CString it will not work as it will output it's address (I think)
You should cout << (LPCTSTR)str; to get it work.
Best regards,
Alexandru Savescu
|
|
|
|
|
ok.. I'm trying to unzip the file with WinZip using system()
<br />
system("wzunzip -d \"c:\\test.zip\" c:\\temp\\); // unzipping the file, test.zip, with WinZip from command prompt.<br />
it works but "c:\\test.zip" can be any file name.. there fore i have to create
<br />
CString commandLine = "wzunzip -d \"\" + fileName +" \"\" + "c:\\temp\\"; <br />
system(commandLine); <br />
|
|
|
|
|
CString str, word;
word = "world!!!";
str = "hello \"" + word + "\"";
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello all,
I am here to pester you guys with more project and code questions.
So here is the current one that maybe you guys can explain to me.
Let's say I do not want my MDI Child window to close when you press the 'X' button in the top right. So, I figured to do this, I would edit OnCloseDocument, and ahve it do...you guessed it....absolutely nothing. I comment out the CDocument::OnCloseDocument(); statement.
Voila, the 'X' button no longer works. So I was kinda right. Here's the fun part. I press the 'X', the project doesn't close, like I figure. BUT, I press exit, to exit everything, and in the Taskmanager, the project is still there.
I think this is bad.
What do you guys think? Anyideas on how to render the 'X' button ineffectual?
Thanks,
NickOne
|
|
|
|
|
Can't you just handle (and do nothing in the handler) WM_CLOSE in mdi child frame class?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Arghh....
You are right if this was a regular MDI program!!!! I did it on a different MDI program and it held up.
The one I am working on right now though doesn't have a Child MDI class. So I can't access WM_CLOSE because there is no class for it. I CAN get to WM_CLOSE in the Mainframe.cpp file, but I don't think that will do me much good.
Thanks though! I appreciate it!
Any more ideas maybe?
NickOne
~Always listening~
|
|
|
|
|
NickOne wrote:
The one I am working on right now though doesn't have a Child MDI class
What do you mean exactly? You're using CMDIChildWnd or MDI child windows are created by code you can't control?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|