|
One more item that might be important...
The m_hWnd I'm using references is an ATL Control. It is hosted in a CWnd. I just figured out that if I change "CWnd::FromHandle(m_hWnd)" to CWnd::FromHandle(this->GetParent())" my DrawItem function gets called. The header is drawn in the wrong place (since it is now drawn in the parent), but I can get around that if I have to.
Edit: Never mind. That doesn't actually work. I thought it was.
It seems like the problem is that the message is just never getting down to my window. In wincore.cpp in the CWnd::ReflectLastMsg function and the LookupPermanent call is failing. So I think there is something wrong with the way I have things setup.
|
|
|
|
|
Take a look at this article which uses the DrawItem method for a multiline header items:
Multiline header control[^]
This method should work, as I use it in one my apps.
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
I found the answer! (or at least _an_ answer)
For _most_ applications, I think the Multiline header control way of doing things will work just fine, but unfortunately, I'm constrained to an environment where that doesn't work and I have to use a custom ATL control and this just doesn't work. So...
The ATL control that hosts the header gets WM_DRAWITEM messages. So I just made a handler for that and called my DrawItem function directly.
Thanks for your help though!
|
|
|
|
|
Hi,
Is there any way to get the resolution of an image file(.bmp file) other than refering to biXPelsPerMeter value?
Regards
Neha
|
|
|
|
|
i need to write a c++ program that converts a expression in infix form to postfix form
how to do this job?
can someone kindly help me in this regard!
ranjani
|
|
|
|
|
Hi,
In my client area I have some text. During selection, my text color is inverted that is implemented by ::invertRect() API. This api just invert the bits of the area specifed in the invertRect parameter.
I want my back color during selection should be of different color which I will select. Iam not getting how and what raster operation to do... ..
So plz let me know how I can do it using any Raster Operation.
Umesh
Its ATTITUDE not APTITUDE that help One to achieve ALTITUDE.
|
|
|
|
|
Hi All
I want to ask question about MSAgent character editor.
1. Can i create my own "STATE" in MSAgent character editor. There are pre-defined "state" in MSAgent character editor,so i want to add more. Can i do it.
2. What is the meaning of one state with multiple animation.
|
|
|
|
|
I'm quite confused!
Writing a simple win32 console application using sockets, I get an unexpected "Win32 Thread" in my application.
The following sample application has two thread (the main thread, and the unexpected win32 thread".
Has anyone noticed this, and what is this extra thread used for?
#include "winsock2.h"<br />
<br />
void main()<br />
{<br />
WSADATA info;<br />
<br />
if(WSAStartup(MAKEWORD( 2, 0 ),&info))<br />
return;<br />
<br />
char name[1000];<br />
int len=1000;<br />
<br />
gethostname(name,len);
<br />
Sleep(10000);<br />
<br />
WSACleanup();<br />
}
PS: I link to ws2_32.lib
// Niklas
|
|
|
|
|
It's ok, it's part of the WinSock system.
When you call WSAStartup it does a bunch of stuff, create pipes, initialize structures, create monitor thread.
I would expect it to go away when you call WSACleanup.
There is a port of WinSock, with source, as part of Wine (? i think).
If you look at their source you will see what the other thread is/can be used for.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I cannot remove a blank directory in Windows 2000 using RemoveDirectory whilst I can do the same with same code in windows 98 - Please Help
boby
|
|
|
|
|
removedirectory surely works in 2000. check what's the error occured while removedirectory() thru getlasterror(). for details refer MSDN. otherwise you can try _rmdir() function.
Murali.M
there is always one more bug.........
|
|
|
|
|
bochan wrote:
how a
Here! Another one for you! But probably :grass: would be more appropriate?!
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
//A.h
Class A
{
A(int i, int j);
int GetIJ();
int K,L;
}
//A.cpp
{
A::A(int i, int j)
{
K=i;
L=j;
}
A::GetIJ()
{
int M=K+L;
return M;
}
}
//B.cpp
A *ATemp;
{
void B::FirstFunction()
{
int a=5;
int b=6;
A aTest(a,b); //Create a A Instance "aTest"
ATemp=&aTest; //assign aTest to ATemp
}
void B::SecondFunction()
{
int XYZ=ATemp->GetIJ();
//Is this correct? If this is wrong please tell me why
}
}
**************
Can I Create a Object in one function and using the object at another function?
|
|
|
|
|
Not this way. You have created the object on the stack in the first function and so the object is destroyed when the function returns. Therefore, your pointer to this object is no longer valid outside the
scope of the first function. There are lots of ways to approach this
problem, but one is to return an object of type A by value from the first
function and assign it to another object of type A which is declared outside
the function. The best method depends on the cost of creating and assigning the object.
|
|
|
|
|
I need get a button in the system taskbar,now I have got a pointer of the taskbar,but I can't catch a specific button in this taskbar,Please help me,thanks.
|
|
|
|
|
How do I programatically add a "Direct Connection between to Computers" assigned to COM5 ?
Just start the "Add Modem Dialog" is not a solution for me.
WinExec("rundll32.exe shell32.dll,Control_RunDLL Modem.cpl,,add",1);
Adding a Phonebook entry to this device with RasEnumDevices and manipulate the entries for SLIP is no Problem.
|
|
|
|
|
I created a dialog without title bar,so it has not a combine button in system taskbar,I used "ModifyStyleEx" Func to add a button in taskbar,then I used "LoadIcon" and "SetIcon" add a icon to this dialog.
The Question occured: when I pressed "ALT"+"TAB" two keys,this Application icon show in window is a system icon!!The icon in taskbar is mine only!
Why??Thanks.
------------------------------------------------------
Jerry Wong
Http://www.alphastudio.org
MSN:hotalpha@hotmail.com
|
|
|
|
|
Even if your dialog does not have a title bar, still you should set the Icon property for that form, to a valid Icon object.
|
|
|
|
|
Do you have the proper permissions to do it? Win2000/XP requires permissions, whereas Win98 doesn't, so this is the most likely cause.
|
|
|
|
|
|
Hello ppl
following is the code snippet
if(!AfxSocketInit())
AfxMessageBox("Socket Init Error");
if(mysocket.Create(6000,SOCK_STREAM) == TRUE)
AfxMessageBox("Socket Created");
if(server.Create(3000,SOCK_STREAM) == TRUE)
AfxMessageBox("Server Socket Created");
if(server.Connect("172.16.65.122",6000) == TRUE)
AfxMessageBox("Connected to client");
else
{
int a = server.GetLastError();
AfxMessageBox((CString)a);
}
what i am trying to do here is that i need to connect to the same machine using socks for that reason i have created two sockets one that actually should act as a client and other as a server now both the sockets are created successfully but server is unable to connect to the client (remember client is the same machine as server) the error no that is returned is 3 and i dont know what it means please help me out i am a socket newbie
thanks
|
|
|
|
|
if i read well ur server is connecting to a client???
this is odd
try that the client connects to the server
the server must be listening to its socket
(look at Listen and Bind)
i recomand you to look for NDK on CP
anyway the error code 3 means "The system cannot find the path specified. ERROR_PATH_NOT_FOUND"
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
i want to have a lable with arabic font but the studio does'nt support arabic fonts how could i have a lable or menue with arabic fonts?
|
|
|
|
|
|
Have you got "wWinMainCRTStartup" as your "Entry-point symbol" ("Output" category of "Link" tab on project settings dialog) ? I had some linker errors when first building for unicode and I found that fixed it.
|
|
|
|