|
-
June 11th, 1999, 05:43 AM
#1
Help !!! Why CSocket crash when using static link...
Hello :
I used a CSocket object for sending data in a thread object
(a instance of a class derived from CThread). If I selected "Using
MFC in a shared DLL", everything would go correctly. But
If I selected "Using MFC in a static library", the program
would crash when creating the CSocket object. Part of codes
is as following :
1. Create the thread :
CSendDataThread sendThread ; // CSendDataThread is derived from CThread
sendThread.CreateThread () ; // create thread
2. Initialize the thread :
BOOL CSendDataThead::InitInstance ()
{
CSocket s ;
s.Create () ; // here crash !
...
...
return TRUE ;
}
I traced the sorce code in MFC and found that the code try to
access a varible in a CMapPtrToPtr object (perhaps it was not "new"ed
yet or had already been "delete"ed.) But, what puzzled me mostly, when using
dynamic linking MFC, all would run smoothly. Anyone help me?
Best Regards !
-- Dang --
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|