Click here to Skip to main content
15,910,661 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralUrgent help please!!!!!!!!!!!!!!!!!! Pin
xxhimanshu14-May-03 2:01
xxhimanshu14-May-03 2:01 
GeneralRe: Urgent help please!!!!!!!!!!!!!!!!!! Pin
Franz Klein14-May-03 4:22
Franz Klein14-May-03 4:22 
GeneralRe: Urgent help please!!!!!!!!!!!!!!!!!! Pin
Joan M14-May-03 5:14
professionalJoan M14-May-03 5:14 
QuestionHow To Enumerate CMDIChildWnd's Opened at any Particular Instance Of Running Application Pin
Vikrant Vikrant14-May-03 1:29
Vikrant Vikrant14-May-03 1:29 
AnswerRe: How To Enumerate CMDIChildWnd's Opened at any Particular Instance Of Running Application Pin
basementman14-May-03 5:25
basementman14-May-03 5:25 
QuestionHow do I display a border around the client area?? Pin
IrishSonic14-May-03 1:28
IrishSonic14-May-03 1:28 
AnswerRe: How do I display a border around the client area?? Pin
John R. Shaw14-May-03 7:18
John R. Shaw14-May-03 7:18 
QuestionStack overflow when calling one DLL function often? Pin
Dominik Reichl14-May-03 1:23
Dominik Reichl14-May-03 1:23 
Hello,

I have a problem with DLLs again Frown | :(
I have to load two DLLs which each contain 3 functions. The first function has to be called one time, the second very often, and the third only one time.

Now I call the second function about 60000 (each DLL) and I get a stack overflow???

The DLL function is:
DLL_C_EXPORT unsigned long gdPlay(unsigned long uRound, unsigned long uEnemyLast)
{
	return (unsigned long)(rand() % 2);
}
The calling loop in the main project is:
for(dwRound = 0; dwRound < m_dwRounds; dwRound++)
{
	dwCurrent1 = lpDllPlay1(dwRound, dwLast2);
	dwCurrent2 = lpDllPlay2(dwRound, dwLast1);
	if((dwCurrent1 == 1) && (dwCurrent2 == 1))
	{
		dwPoints += m_dwPoints11;
	}
	if((dwCurrent1 == 1) && (dwCurrent2 == 0))
	{
		dwPoints += m_dwPoints10;
	}
	if((dwCurrent1 == 0) && (dwCurrent2 == 1))
	{
		dwPoints += m_dwPoints01;
	}
	if((dwCurrent1 == 0) && (dwCurrent2 == 0))
	{
		dwPoints += m_dwPoints00;
	}
	dwLast1 = dwCurrent1; // Update variables
	dwLast2 = dwCurrent2;
}
The DLL is loaded perfectly and it also returns the correct values (I checked it with MessageBoxes)... But after some calls (about 60000 each) there is the stack overflow...

Do you have any idea what could cause the stack overflow??? Confused | :confused: Confused | :confused: Confused | :confused:

-Dominik



_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? Wink | ;)

AnswerRe: Stack overflow when calling one DLL function often? Pin
Anonymous14-May-03 1:32
Anonymous14-May-03 1:32 
GeneralRe: Stack overflow when calling one DLL function often? Pin
Neville Franks14-May-03 1:34
Neville Franks14-May-03 1:34 
GeneralRe: Stack overflow when calling one DLL function often? Pin
Dominik Reichl14-May-03 4:02
Dominik Reichl14-May-03 4:02 
GeneralRe: Stack overflow when calling one DLL function often? Pin
Dominik Reichl14-May-03 4:09
Dominik Reichl14-May-03 4:09 
GeneralRe: Stack overflow when calling one DLL function often? Pin
Neville Franks14-May-03 11:10
Neville Franks14-May-03 11:10 
GeneralRe: Stack overflow when calling one DLL function often? Pin
Dominik Reichl14-May-03 20:22
Dominik Reichl14-May-03 20:22 
GeneralRe: Stack overflow when calling one DLL function often? Pin
Neville Franks14-May-03 22:32
Neville Franks14-May-03 22:32 
GeneralCaller ID compatible modems Pin
YSRao14-May-03 0:11
YSRao14-May-03 0:11 
GeneralRe: Caller ID compatible modems Pin
Renjith Ramachandran15-May-03 5:59
Renjith Ramachandran15-May-03 5:59 
GeneralMoving a file Pin
dave_long14-May-03 0:09
dave_long14-May-03 0:09 
GeneralRe: Moving a file Pin
Neville Franks14-May-03 0:44
Neville Franks14-May-03 0:44 
GeneralRe: Moving a file Pin
Rage14-May-03 1:07
professionalRage14-May-03 1:07 
GeneralConvert DWORD to CString Pin
JensB13-May-03 23:58
JensB13-May-03 23:58 
GeneralRe: Convert DWORD to CString Pin
YSRao14-May-03 0:41
YSRao14-May-03 0:41 
GeneralRe: Convert DWORD to CString Pin
YSRao14-May-03 0:50
YSRao14-May-03 0:50 
GeneralRe: Convert DWORD to CString Pin
YSRao14-May-03 0:51
YSRao14-May-03 0:51 
GeneralRe: Convert DWORD to CString Pin
JensB14-May-03 1:20
JensB14-May-03 1:20 

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.