Click here to Skip to main content
15,899,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questiondifference between char* and char** in C++ Pin
kDevloper18-Nov-08 1:34
kDevloper18-Nov-08 1:34 
AnswerRe: difference between char* and char** in C++ Pin
_AnsHUMAN_ 18-Nov-08 1:46
_AnsHUMAN_ 18-Nov-08 1:46 
AnswerRe: difference between char* and char** in C++ Pin
toxcct18-Nov-08 1:48
toxcct18-Nov-08 1:48 
QuestionHow to detect if F1 is pressed in an MFC application ? Pin
kapardhi18-Nov-08 1:06
kapardhi18-Nov-08 1:06 
AnswerRe: How to detect if F1 is pressed in an MFC application ? Pin
_AnsHUMAN_ 18-Nov-08 1:25
_AnsHUMAN_ 18-Nov-08 1:25 
AnswerRe: How to detect if F1 is pressed in an MFC application ? Pin
Jijo.Raj18-Nov-08 6:39
Jijo.Raj18-Nov-08 6:39 
AnswerRe: How to detect if F1 is pressed in an MFC application ? Pin
dupenf118-Nov-08 14:32
dupenf118-Nov-08 14:32 
QuestionKeep Socket^ variable in the global scope Pin
cra03418-Nov-08 0:35
cra03418-Nov-08 0:35 
Hello all,(Sory about my English) Please help....
VC++ 2005.
I have a func that call to Socket,Bind, Listen & Receive.
I call this func from timer that see if the Client send data.
I get the data in the first call but in the second call I got errors.
I understand that I need to operate the Socket,Bind, Listen only once.
I got err when put this line in a global scope or as a member data in class declaration:
Socket^ listenerSocket = nullptr;

So, I tried to store it with the help of global pointer.
It is good till I call the funcs of the Socket type, after all it just pointer that set to some place in the memory.

Socket^ *GlistenerSocket = nullptr;
Socket^ *GserverSocket = nullptr;
int CMotoScopeDlg::DoSocketGet( String^ server )
{
Socket^ listenerSocket = nullptr;
listenerSocket = gcnew Socket( AddressFamily::InterNetwork,SocketType::Stream,ProtocolType::Tcp );

if (false == SocketBindFlag )
{
listenerSocket = gcnew Socket( AddressFamily::InterNetwork,SocketType::Stream,ProtocolType::Tcp );
GlistenerSocket = &listenerSocket ;
(*GlistenerSocket)->Bind(hostEndPoint ); //Only once
(*GlistenerSocket)->Listen( 4 );
SocketBindFlag = true;
}else{
listenerSocket = *GlistenerSocket; //check this. allocate place??
}

Socket^ serverSocket = (*GlistenerSocket)->Accept(); //ERROR at second time

If I could put this Socket variable in the global place it will help.

Thanks in advance,
Eyal
AnswerRe: Keep Socket^ variable in the global scope Pin
Iain Clarke, Warrior Programmer18-Nov-08 1:55
Iain Clarke, Warrior Programmer18-Nov-08 1:55 
QuestionWM_COPYDATA Pin
john563217-Nov-08 23:17
john563217-Nov-08 23:17 
AnswerRe: WM_COPYDATA Pin
SandipG 17-Nov-08 23:28
SandipG 17-Nov-08 23:28 
AnswerRe: WM_COPYDATA Pin
Roger Stoltz17-Nov-08 23:55
Roger Stoltz17-Nov-08 23:55 
AnswerRe: WM_COPYDATA Pin
Code-o-mat18-Nov-08 3:55
Code-o-mat18-Nov-08 3:55 
QuestionHow to open a help file (.chm file) programmatically ? Pin
kapardhi17-Nov-08 23:01
kapardhi17-Nov-08 23:01 
AnswerRe: How to open a help file (.chm file) programmatically ? Pin
Chandrasekharan P17-Nov-08 23:24
Chandrasekharan P17-Nov-08 23:24 
AnswerRe: How to open a help file (.chm file) programmatically ? Pin
SandipG 17-Nov-08 23:26
SandipG 17-Nov-08 23:26 
AnswerRe: How to open a help file (.chm file) programmatically ? Pin
Hamid_RT17-Nov-08 23:43
Hamid_RT17-Nov-08 23:43 
GeneralRe: How to open a help file (.chm file) programmatically ? Pin
kapardhi18-Nov-08 0:01
kapardhi18-Nov-08 0:01 
GeneralRe: How to open a help file (.chm file) programmatically ? Pin
Hamid_RT18-Nov-08 0:52
Hamid_RT18-Nov-08 0:52 
GeneralRe: How to open a help file (.chm file) programmatically ? Pin
kapardhi18-Nov-08 1:07
kapardhi18-Nov-08 1:07 
GeneralRe: How to open a help file (.chm file) programmatically ? Pin
Hamid_RT18-Nov-08 1:34
Hamid_RT18-Nov-08 1:34 
Questioncan i assign 2 control variables to list box control? Pin
puppya17-Nov-08 22:56
puppya17-Nov-08 22:56 
AnswerRe: can i assign 2 control variables to list box control? Pin
_AnsHUMAN_ 18-Nov-08 0:24
_AnsHUMAN_ 18-Nov-08 0:24 
Questionhi Pin
Pryabu17-Nov-08 22:49
Pryabu17-Nov-08 22:49 
AnswerRe: hi Pin
Saurabh.Garg17-Nov-08 23:02
Saurabh.Garg17-Nov-08 23:02 

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.