Click here to Skip to main content
15,898,538 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Win32 edit box problems Pin
18-Sep-01 22:19
suss18-Sep-01 22:19 
GeneralRe: Win32 edit box problems Pin
Christian Graus18-Sep-01 22:25
protectorChristian Graus18-Sep-01 22:25 
GeneralRe: Win32 edit box problems Pin
Paul A. Howes19-Sep-01 3:05
Paul A. Howes19-Sep-01 3:05 
QuestionHow can I programmatically insert an OLE objects (or image) into RTF control??? Pin
Youknowme18-Sep-01 18:22
Youknowme18-Sep-01 18:22 
GeneralThread and ActiveX component Pin
Farah Mansor18-Sep-01 18:13
Farah Mansor18-Sep-01 18:13 
GeneralRe: Thread and ActiveX component Pin
Ghazi H. Wadi19-Sep-01 14:01
Ghazi H. Wadi19-Sep-01 14:01 
GeneralRe: Thread and ActiveX component Pin
Farah Mansor19-Sep-01 15:32
Farah Mansor19-Sep-01 15:32 
GeneralRe: Thread and ActiveX component Pin
Ghazi H. Wadi19-Sep-01 16:52
Ghazi H. Wadi19-Sep-01 16:52 
Hi,
this is assuming that the variable *pDlg has been initilized
to be equal to the this pointer of myDlg when it is created ,
in the oninitdialog or so


If the mySocket variable exist the error should happen
somewhere here
bool CSocketSvr::GetConnectedStatus()
{
....
return result;
}

if it does not exist, then it should not have been called at all unless you have multiple threads accessing the same instance.

on the other hand it could be that you are accessing the same variable while it is being used. (the case each time new data is being received)

so you must call the lock before you call any operation on the variable.

Here is a simple way without using MFC

1) Declare critical section
CRITICAL_SECTION g_CriticalSection;
...
..
..

2) When Program Starts, initilize the critical section
::InitializeCriticalSection (&g_CriticalSection);

3) When the program terminate, delete the critical section
::DeleteCriticalSection (&g_CriticalSection);

4) Whenever you are accessing mySocket
::EnterCriticalSection (&g_CriticalSection);
if (mySocket.GetConnectedStatus()) <--- THIS IS WHERE IT GIVES ME THE RUNTIME ERROR
{
..
}
::LeaveCriticalSection(&g_CriticalSection);



It is Illogical to define an inventor by his invention

Cheers
Alfadhly
GeneralRe: Thread and ActiveX component Pin
Farah Mansor19-Sep-01 21:04
Farah Mansor19-Sep-01 21:04 
GeneralRe: Thread and ActiveX component Pin
Ghazi H. Wadi20-Sep-01 12:46
Ghazi H. Wadi20-Sep-01 12:46 
GeneralRe: Thread and ActiveX component Pin
Farah Mansor20-Sep-01 15:58
Farah Mansor20-Sep-01 15:58 
GeneralRe: Thread and ActiveX component Pin
Ghazi H. Wadi21-Sep-01 16:09
Ghazi H. Wadi21-Sep-01 16:09 
GeneralRe: Thread and ActiveX component Pin
24-Sep-01 19:47
suss24-Sep-01 19:47 
Generalconsecutive sums Pin
minikg18-Sep-01 15:38
minikg18-Sep-01 15:38 
GeneralRe: consecutive sums Pin
Christian Graus18-Sep-01 16:02
protectorChristian Graus18-Sep-01 16:02 
GeneralRe: consecutive sums Pin
minikg18-Sep-01 16:04
minikg18-Sep-01 16:04 
GeneralRe: consecutive sums Pin
minikg19-Sep-01 12:28
minikg19-Sep-01 12:28 
GeneralRe: consecutive sums Pin
Christian Graus19-Sep-01 12:47
protectorChristian Graus19-Sep-01 12:47 
GeneralRe: consecutive sums Pin
minikg19-Sep-01 13:22
minikg19-Sep-01 13:22 
GeneralRe: consecutive sums Pin
Christian Graus19-Sep-01 14:23
protectorChristian Graus19-Sep-01 14:23 
GeneralRe: consecutive sums Pin
Christian Graus19-Sep-01 14:40
protectorChristian Graus19-Sep-01 14:40 
GeneralRe: consecutive sums Pin
Christian Graus19-Sep-01 14:42
protectorChristian Graus19-Sep-01 14:42 
GeneralRe: consecutive sums Pin
Christian Graus19-Sep-01 14:58
protectorChristian Graus19-Sep-01 14:58 
GeneralRe: consecutive sums Pin
Christian Graus19-Sep-01 16:32
protectorChristian Graus19-Sep-01 16:32 
QuestionHow do you remove help from a project? Pin
Cathy18-Sep-01 14:21
Cathy18-Sep-01 14:21 

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.