|
bcemick wrote:
Any ideas?
No, that does not make any sense to me. Create() is returning 1 (success) but the buttons HWND is zero (not a window). I am at a loss.
Just for the heck of it maybe you can try doing a rebuild all, that will sometimes fix weird errors.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Tracing into the MFC source for CButton::Create() we get to this code in CWnd::CreateEx (in Wincore.cpp)
#ifdef _DEBUG
if (hWnd == NULL)
{
TRACE1("Warning: Window creation failed: GetLastError returns 0x%8.8X\n",
GetLastError());
}
#endif
if (!AfxUnhookWindowCreate())
PostNcDestroy();
if (hWnd == NULL)
return FALSE;
ASSERT(hWnd == m_hWnd);
return TRUE; So there is no way that Create will return TRUE (1) if the HWND is NULL (0).
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
PJ Arends wrote:
So there is no way that Create will return TRUE (1) if the HWND is NULL (0).
I know. That's what was so weird about all of this. I swear that's what was happening. I tried rebuild all and now it's returning a non-NULL handle; the handle is still invalid though.
I tried moving it into another function to see what would happen. I got hWnd handles, but none of them are valid handles according to Spy++. It is still returning 1 (success).
The only thing I can think of is that the button is being created, but it's being destroyed before it can be added to the property sheet (if that makes sense - it sounds better in my head). It's either that or I am missing something so obvious that it would've killed me if it was a snake.
One way or another, I'm going to make this work.
Any help is greatly appreciated (and you've been great so far). If nothing else, it eliminates a possibility.
|
|
|
|
|
One last guess, I am sure you did but I have to ask anyway because I am running out of ideas, did you make your CButton variable a member of your CPropertySheet derived class? I ask this because the only way the button would be destroyed before it is added to the sheet is if your CButton variable is going out of scope and being destroyed that way.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
PJ Arends wrote:
did you make your CButton variable a member of your CPropertySheet derived class?
ummm....of course I...ummm...you know...umm...
Thank you. I'll go slam my head into a wall repeatedly.
Now I just have to figure out how to get into the right place and then line up those other buttons beside it. Which I will. On my own. So I don't look so incredibly dense.
|
|
|
|
|
|
(Kid?)
I listened; I really did. I was so sure that I had done it that I almost didn't go check to make sure I had. But, to be on the safe side, I checked. Lo and behold, I had either been attacked by a case of The Stupids and forgotten to do it or deleted it while messing around with it.
Either way, thank you for the help.
|
|
|
|
|
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Well I never thought it possible but I have a strange problem it appears to be a release problem as I have not seen it in debug. For some reason while using the application I get the following runtime error:
Runtime Error!
Program: <program name="">
R6025
- pure virtual function call
I do not believe that I am calling the pure virtual function from the derived class as I do not get the problem all the time.
Does anyone have any suggestions in tracking this down?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Do you have any pure virtual function definitions?
The most likely cause is a runtime memory scribble. Something is causing the vtable to be overwritten with rubbish.
|
|
|
|
|
Jay Carter wrote:
Do you have any pure virtual function definitions?
Yes, quite a few in various classes.
Jay Carter wrote:
The most likely cause is a runtime memory scribble.
Um, I hope this is not the case. Though I do agree with you, it is the most likely cause.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I have a toolbar with a drop down menu. The problem is when it is docked left or right you see the toolbar is wider then those without dropdown, as expected. But my separators paint correctly where expected vertically but it is also painted on the right, you see the separator more then once like 2 and 4 below.
1
2|
-
3
4|
-
5
|
|
|
|
|
How do I hide the selection of an item. I have developed an own multiselect function and would to hide the original selection (the blue color in CTreeCtrl).
Any tip?
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi all,
I am in process of developing a Server in C++ supporting multiple protocols. The server will be exposing various functionalities, and the clients can communicate over any of the protocols may be TCP, IPX, SAP, NETBEUI to access the server to access the functionalities exposed. The server doesnot know in advance which client is using what protocol.
example my server has functionality X()
and i have n number of client.
client1 is communicating over protocol TCP to access X()
client2 is communicating over protocol IPX to access X()
..
and so on.
We had already developed ( prepared a rough code sketch), a server that is able to handle multiple clients at the same time over TCP /IP. But now, we need to enhance the same so that it can intearct with clients irrespective of the protocol being used.
I am struck with following issue:
1) How to make the client-server flow so that the server knows from which protocol the client has communicated so that the server can send the reply over the same protocol and this whole process is multithreaded.
What all steps are needed to take care of while building the system most efficient.
In summary
need to make server in such a way that it may accept a request from connection oriented protocol as well as connection-less protocol at the same time. so need to develop a mechanism for the same the work for all conditions.
Please suggest. Also please feel free to send your comments/suggestions to make this system more efficient.
All suggestions are welcome.
Thanks,
rdh
|
|
|
|
|
why don't you create a thread for each different proctocol?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I need your help!
Any one know how to create a connection in the folder My Network Places in Windows XP using VC++?
Thank you very much
|
|
|
|
|
Are you referring to the NetUseAdd() function?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
Ahhh, you are wanting to create a RAS entry, not a network connection (I think). For that you'll need to use the RAS-related functions. I'm not sure which is the exact one, but start with RasCreatePhonebookEntry() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thank you very much! Now I know the clue to this problem.
However, the function RasCreatePhonebookEntry() only show a dialog for user to create a connection step by step. I need a function to do it programatically. All properties are set programatically.
Does the function RasCustomEntryDlg() help me? Or I have to find another way?
|
|
|
|
|
You'll need to use RasSetEntryProperties() instead.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi David Crow!
It is a long time I don't contact with you. Can you ask you one more question?
I downloaded a VPN client software in the site http://www.umkc.edu/vpn/[^]
After installed, the software create a connection in "network connection". The thing is that new connection is very strage. It has its own dialog and its type is "connection manger".
I have been trying to figure out how the software can do that for a long time. Unfortunately I can't find the answer.
Can you help me?
Thank you very much.
Long
|
|
|
|
|
I have a report layout for a CListControl.
The control comes up with nothing selected and I'd like
to select automatically the first item as a default selection.
For List boxes SetSel would do this for me.
I can't find a similar command for this control.
It should be simple, but I don't see it.
Thanks
Ilan
|
|
|
|
|
Assuming you mean CListCtrl, Try the following:
UINT uflag = LVIS_SELECTED;
SetItemState(0, uflag, uflag);
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
It worked. Sorry I missed it, but thanks for your help.
|
|
|
|