Click here to Skip to main content
14,664,816 members
Home » Discussions » ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: get instance of object (in exe) from dll caller Pin
xenotron17-Sep-12 6:57
Memberxenotron17-Sep-12 6:57 
GeneralRe: get instance of object (in exe) from dll caller Pin
MrKBA17-Sep-12 9:32
MemberMrKBA17-Sep-12 9:32 
JokeRe: get instance of object (in exe) from dll caller Pin
xenotron17-Sep-12 13:43
Memberxenotron17-Sep-12 13:43 
GeneralRe: get instance of object (in exe) from dll caller Pin
xenotron17-Sep-12 13:48
Memberxenotron17-Sep-12 13:48 
AnswerRe: get instance of object (in exe) from dll caller Pin
Richard MacCutchan17-Sep-12 22:16
mveRichard MacCutchan17-Sep-12 22:16 
AnswerRe: get instance of object (in exe) from dll caller Pin
Stephen Hewitt18-Sep-12 18:49
MemberStephen Hewitt18-Sep-12 18:49 
QuestionCAsyncSocket Connect says in use Pin
bkelly1316-Sep-12 6:07
Memberbkelly1316-Sep-12 6:07 
Answerunexpected behavior Pin
bkelly1316-Sep-12 10:07
Memberbkelly1316-Sep-12 10:07 
Following the OP, and per various tutorials I have found, I have created skeleton methods and virtual overrides everywhere I think there should be one I have also set breakpoints in all these methods. The results are not expected and quite interesting.

Note: The send time class is instantiated in the C_Server::Accept() method called by the Accept button in the dialog and passed into the Accept() method that I think is the one from the base class CAsyncSocket. Is that the correct action to perform?

After clicking the Connect for the Client class, the breakpoint is activated in C_Client::OnConnect( int nErrorCode)

The error code said the port was in use, but I am now thinking that maybe the error code should be expected and considered normal. Maybe I should write code in here for when the connect is successful. Per an example this method has code to call CAsyncsocket::OnConnect( int x ); I presume that is the base class. That function has no code. Should there be anything there?

Click Run in the debugger to see what happens and,…

The breakpoint in C_Server::OnAccept( int error_code ) is called. Thanks to an example I found, it calls CAsyncSocket::OnAccept( error_code ) which again is empty. I am now presuming that despite the earlier error code, the server code, the part within the Windows API that I don’t see, has indeed accepted the connection and it ready to send data to and receive data from the client. Is this indeed the case? If so, is there something that should be done in this method?

Clicking the debugger run one more time,
The breakpoint in C_Client::OnSend( int error_code ) is called.

Now this is puzzling. My code does not send anything. Is this telling me the client is expected to send something to the server? What should it send?

Thanks for your time

-- modified 16-Sep-12 16:45pm.
AnswerRe: CAsyncSocket Connect says in use Pin
Richard Andrew x6416-Sep-12 11:53
professionalRichard Andrew x6416-Sep-12 11:53 
AnswerRe: CAsyncSocket Connect says in use Pin
xenotron16-Sep-12 12:05
Memberxenotron16-Sep-12 12:05 
GeneralRe: CAsyncSocket Connect says in use Pin
bkelly1316-Sep-12 12:55
Memberbkelly1316-Sep-12 12:55 
GeneralRe: CAsyncSocket Connect says in use Pin
xenotron16-Sep-12 13:09
Memberxenotron16-Sep-12 13:09 
GeneralRe: CAsyncSocket Connect says in use Pin
bkelly1316-Sep-12 13:17
Memberbkelly1316-Sep-12 13:17 
GeneralRe: CAsyncSocket Connect says in use Pin
xenotron16-Sep-12 13:34
Memberxenotron16-Sep-12 13:34 
GeneralRe: CAsyncSocket Connect says in use Pin
bkelly1316-Sep-12 14:07
Memberbkelly1316-Sep-12 14:07 
Questionbetter version of strcpy() and printf() Pin
bkelly1315-Sep-12 10:02
Memberbkelly1315-Sep-12 10:02 
AnswerRe: better version of strcpy() and printf() Pin
Paul M Watt15-Sep-12 12:33
mentorPaul M Watt15-Sep-12 12:33 
GeneralRe: better version of strcpy() and printf() Pin
bkelly1315-Sep-12 15:34
Memberbkelly1315-Sep-12 15:34 
GeneralRe: better version of strcpy() and printf() Pin
Paul M Watt15-Sep-12 15:45
mentorPaul M Watt15-Sep-12 15:45 
GeneralRe: better version of strcpy() and printf() Pin
bkelly1315-Sep-12 16:23
Memberbkelly1315-Sep-12 16:23 
GeneralRe: better version of strcpy() and printf() Pin
xenotron16-Sep-12 6:54
Memberxenotron16-Sep-12 6:54 
GeneralRe: better version of strcpy() and printf() Pin
Richard MacCutchan16-Sep-12 0:10
mveRichard MacCutchan16-Sep-12 0:10 
AnswerRe: better version of strcpy() and printf() Pin
Richard Andrew x6415-Sep-12 17:01
professionalRichard Andrew x6415-Sep-12 17:01 
AnswerRe: better version of strcpy() and printf() Pin
Richard MacCutchan16-Sep-12 0:09
mveRichard MacCutchan16-Sep-12 0:09 
AnswerRe: better version of strcpy() and printf() Pin
xenotron16-Sep-12 1:37
Memberxenotron16-Sep-12 1:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.