Click here to Skip to main content
11,578,739 members (63,028 online)

ATL / WTL / STL

 
Questionget instance of object (in exe) from dll caller Pin
khaliloenit17-Sep-12 4:38
memberkhaliloenit17-Sep-12 4:38 
AnswerRe: get instance of object (in exe) from dll caller Pin
pasztorpisti17-Sep-12 6:57
memberpasztorpisti17-Sep-12 6:57 
GeneralRe: get instance of object (in exe) from dll caller Pin
khaliloenit17-Sep-12 9:32
memberkhaliloenit17-Sep-12 9:32 
JokeRe: get instance of object (in exe) from dll caller Pin
pasztorpisti17-Sep-12 13:43
memberpasztorpisti17-Sep-12 13:43 
GeneralRe: get instance of object (in exe) from dll caller Pin
pasztorpisti17-Sep-12 13:48
memberpasztorpisti17-Sep-12 13:48 
AnswerRe: get instance of object (in exe) from dll caller Pin
Richard MacCutchan17-Sep-12 22:16
mvpRichard 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 
Environment Windows 7, Visual Studio 2008, MFC, C++

Goal:   create an asynchronous server and client class to demonstrate a simple server client operation. Base class for Server and Client is CAsyncSocket.   IP address 127.0.0.1, port 49000

Status:   The dialog has buttons for the server to Initialize, Listen, and Accept, so far.   It also has buttons for the client to Initialize and Connect.   Both have Close buttons.   One dialog but two separate classes.   Umm, make that three counting the CAsyncSocket class used by the server to communicate after the two have connected.

In the server group buttons Initialize and Accept appear to work correctly, in that order of course.   The returned status is TRUE and wsa error code is zero.   The Listen button creates a new object to handle the transactions and gets WSA code 10035 WSAEWOULDBLOKC, would block, treated as an expected result.   Good so far.   Now, hopefully, the server object is waiting for the client.

Then the buttons for the client are selected to Initialize, wsa error = 0, then Connect to the same IP address and port.   It gets wsa error code 10048,   WSAEADDRINUSE, address already in use.   Hmmm.   Yeah, it is in use, but if it is not in use by a server then the client cannot connect.  

I believe I have the code working as I expect, but there is a fundamental error in my logic.   Is this sufficient info for someone to tell me what I have done wrong or omitted?   What might that error be?

Thanks for your time
Answerunexpected behavior Pin
bkelly1316-Sep-12 10:07
memberbkelly1316-Sep-12 10:07 
AnswerRe: CAsyncSocket Connect says in use Pin
Richard Andrew x6416-Sep-12 11:53
memberRichard Andrew x6416-Sep-12 11:53 
AnswerRe: CAsyncSocket Connect says in use Pin
pasztorpisti16-Sep-12 12:05
memberpasztorpisti16-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
pasztorpisti16-Sep-12 13:09
memberpasztorpisti16-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
pasztorpisti16-Sep-12 13:34
memberpasztorpisti16-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 Watt15-Sep-12 12:33
mentorPaul 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 Watt15-Sep-12 15:45
mentorPaul 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
pasztorpisti16-Sep-12 6:54
memberpasztorpisti16-Sep-12 6:54 
GeneralRe: better version of strcpy() and printf() Pin
Richard MacCutchan16-Sep-12 0:10
mvpRichard MacCutchan16-Sep-12 0:10 
AnswerRe: better version of strcpy() and printf() Pin
Richard Andrew x6415-Sep-12 17:01
memberRichard Andrew x6415-Sep-12 17:01 
AnswerRe: better version of strcpy() and printf() Pin
Richard MacCutchan16-Sep-12 0:09
mvpRichard MacCutchan16-Sep-12 0:09 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 26 Jun 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid