|
You should retun FALSE from OnInitDialog, if you explicitly set the focus. And use GotoDlgCtrl instead of SetFocus in Dialogs.
- NS -
|
|
|
|
|
I feel a little stupid now. I don't use wizads, but now that you mentioned it, I remebered this "return TRUE unless you're setting the focus" comment that the wizards places in the "return" of the OnInitDialog .
Thanks a lot!
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
This[^] article may interest you.
Steve
|
|
|
|
|
Thanks, very interesting indeed.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Hi,
I have a dialog based application, which should act as a CSocket server.
In short my need is, if some client is connected to the server, OnAccept of the CSocket should be directed to the dialog class member function.
I am not sure about the right method to do so.
Thanks in advance.
- NS -
|
|
|
|
|
You can store a CWnd*, HWND, or whatever is appropriate in your socket class and use
that to send messages to the window/dialog.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for the replay. Is this the only way?
I tried to dervie my dialog class from CDialog and CSocket. But failed...
- NS -
|
|
|
|
|
Do you really need them to be together? Why not separate another class and make that one your CSocket derived class? If your concerned on the variables/objects you need in your dlg class, just pass the class pointer to the CSocket class.
|
|
|
|
|
My concern is that then there will be a mapping from csocket class to the dialog class. I like to avoid it.
- NS -
|
|
|
|
|
Why did the multiple inheritance fail?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It shows compilation error.
There is some ambiguity problem since both are from CObject.
- NS -
|
|
|
|
|
I'm personally not a fan of CAsyncSocket and definitely not CSocket.
If you don't like adding a CWnd* or HWND to the socket class then it's
much easier to use the socket APIs directly.
A SOCKET member can be added to a window/dialog class and Using WSAAsyncSelect
you can get socket notifications directly in the window.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you.
I choose CSocket, because I dont have much knowledge in sockets. So for easiness I found CSocket is good.
I think I have to learn more to do better...
- NS -
|
|
|
|
|
Hi all
can someone help me?
I want to make a toolbar with nice icon (48x48 256 colours) but when i copy my icon, the visual c++ make my icon 16 coluors. Is possible to have icon with 256 coluors?
Thanks in advance
|
|
|
|
|
vasmvr wrote: when i copy my icon, the visual c++ make my icon 16 coluors.
You are probably placing an icon of 256 colors in to 16 color icon. If so you have to add a new icon of 256 colors. It is available in menu, Image > New Device Image.
- NS -
|
|
|
|
|
Thank you, but Where is menu, Image > New Device Image?
|
|
|
|
|
You just open the icon from resource. Could you?
- NS -
|
|
|
|
|
I can't see the menu image.....i'm using visual c++ 6.0.
|
|
|
|
|
ok... can you just show me the caption of the MSDEV?
eg..MyDlgTestApp - Microsoft Visual C++ - [MyDlgTestApp.rc - IDR_MAINFRAME (Icon)]
- NS -
|
|
|
|
|
MyApp - Microsoft Visual C++ - [MyApp.rc - IDR_MYAPP [Italian (Italy)](Bitmap)]
This is the caption
|
|
|
|
|
I undestand what you mean, but in this way i only import an Icon under Icon folder. I want this icon to the toolbar but if i copy to the toolbar it will change in 16 colours. or i do something wrong?
|
|
|
|
|
vasmvr wrote: want this icon to the toolbar but if i copy to the toolbar it will change in 16 colours.
I am not sure about how to directly use it...
But you can show higher color resolution icons in the toolbar by using an imagelist.
Sorry, I dont have a code sample to show you.
- NS -
|
|
|
|
|
Thanks, you mean to create a bitmap with all my icon and then extract each icon from it?
|
|
|
|
|
You can add icons directly to imagelist
- NS -
|
|
|
|
|
Thank u NS, finally i did. Thank you very much for your help.
-- modified at 3:09 Tuesday 4th September, 2007
|
|
|
|