|
i need to create a menu similar to visual c++ menu: can drop buttons on it and more.
i am sure vc menu bar is not common menu, but i don't know what exactly it is: based on CToolBar, CDialogBar or others, and how to implement it.
do u have sample or idea?
thx
includeh10
|
|
|
|
|
I'm not exactly sure what "can drop buttons on it and more" means, but I think all it is, is an owner-draw menu, thats coded to be more interactive. I could be wrong...probably am.
-Ken Mazaika
|
|
|
|
|
thx, but u r ..., things are not so easy.
if u want to learn socket, copy all of vc samples to ur hard disk from cd, then do a search (from vc 'search in files') for CSocket. u can find what u need: easy to learn. but the sample includes 2 parts: server and clint, find both. u will learn in several hrs if u r not a beginner for MFC.
cheers.
includeh10
|
|
|
|
|
in a program, i display several (can be any more) modeless dialog boxes, those dialogs may be overlapped each other.
when user moves mouse over dialogs, i need to do different operations for each one according to their z-order.
top dialg is easy to handle because it has mouse msg, but how to know z-order for others?
thx
includeh10
|
|
|
|
|
If the dialogs have a common parent, you can use EnumChildWindows to list them according their Z orders.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
thanks a lots.
i never use the function before.
u mean, for a special dialog box, it may be second from topmost or third or any, the function can detect the 'number'?
note: the number is changed by mouse click dynamically, not by creating.
hope get ur opinion before my testing.
includeh10
|
|
|
|
|
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
|
|
|
|