Click here to Skip to main content
15,894,343 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
«_Superman_»1-Aug-11 4:12
professional«_Superman_»1-Aug-11 4:12 
GeneralRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
Arris741-Aug-11 6:20
Arris741-Aug-11 6:20 
GeneralRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
«_Superman_»1-Aug-11 6:32
professional«_Superman_»1-Aug-11 6:32 
GeneralRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
Arris742-Aug-11 1:43
Arris742-Aug-11 1:43 
GeneralRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
Albert Holguin1-Aug-11 18:00
professionalAlbert Holguin1-Aug-11 18:00 
GeneralRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
Arris742-Aug-11 1:38
Arris742-Aug-11 1:38 
GeneralRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
Albert Holguin2-Aug-11 4:02
professionalAlbert Holguin2-Aug-11 4:02 
GeneralRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
Arris742-Aug-11 5:02
Arris742-Aug-11 5:02 
GeneralRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
Arris742-Aug-11 5:48
Arris742-Aug-11 5:48 
GeneralRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
Albert Holguin2-Aug-11 6:05
professionalAlbert Holguin2-Aug-11 6:05 
AnswerRe: How a to expose data of an application (.EXE) to a DLL on runtime? Pin
jschell1-Aug-11 8:13
jschell1-Aug-11 8:13 
Questionhow to avoid dead-lock if you write multi-thread programming Pin
yu-jian1-Aug-11 2:50
yu-jian1-Aug-11 2:50 
AnswerRe: how to avoid dead-lock if you write multi-thread programming Pin
Albert Holguin1-Aug-11 3:20
professionalAlbert Holguin1-Aug-11 3:20 
QuestionSOCKET : How to gracfully stop application when recv() function is blocking Pin
pandit841-Aug-11 1:05
pandit841-Aug-11 1:05 
AnswerRe: SOCKET : How to gracfully stop application when recv() function is blocking PinPopular
Peter_in_27801-Aug-11 1:25
professionalPeter_in_27801-Aug-11 1:25 
JokeRe: SOCKET : How to gracfully stop application when recv() function is blocking Pin
Code-o-mat1-Aug-11 5:57
Code-o-mat1-Aug-11 5:57 
AnswerRe: SOCKET : How to gracfully stop application when recv() function is blocking Pin
jschell1-Aug-11 8:17
jschell1-Aug-11 8:17 
GeneralRe: SOCKET : How to gracfully stop application when recv() function is blocking Pin
pandit841-Aug-11 19:34
pandit841-Aug-11 19:34 
QuestionCRichEditCtrl Font Formating Pin
yurii_leorda30-Jul-11 15:11
yurii_leorda30-Jul-11 15:11 
AnswerRe: CRichEditCtrl Font Formating Pin
Code-o-mat30-Jul-11 22:21
Code-o-mat30-Jul-11 22:21 
GeneralRe: CRichEditCtrl Font Formating Pin
yurii_leorda31-Jul-11 0:21
yurii_leorda31-Jul-11 0:21 
GeneralRe: CRichEditCtrl Font Formating Pin
Code-o-mat31-Jul-11 0:37
Code-o-mat31-Jul-11 0:37 
QuestionRuntime Error in Visual Studio [modified] Pin
AndrewG123129-Jul-11 12:09
AndrewG123129-Jul-11 12:09 
I am trying to debug a program that is having a problem loading bitmaps. The program compiles fine, but it crashes whenever I open a bitmap file and try to manipulate it. This is a program I inherited from someone else and it is multi-threaded and fairly large. It has been difficult to track the problem (which seems to be a runtime error), but I have done so with the usual debugging methods (breakpoints, etc) and I am lost with what to look for in the code for the problem. The program was originally built on a much older framework and this has been part of a transition from windows xp to windows 7. However, this transition has not been so easy...and I am not a professional programmer and have been learning as I encounter problems. The program always seems to crash right at this line.

CWinSTMDoc *pDoc = CreateNewDoc(GetDocument());


I step into it and get lost in a world of windows messages...

Here is the output window around where the program crashes:
WinSTM.exe': Loaded 'C:\Windows\System32\wpdshext.dll', Symbols loaded (source information stripped).
'WinSTM.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7600.16385_none_72fc7cbf861225ca\GdiPlus.dll', Symbols loaded (source information stripped).
WinSTM.exe has triggered a breakpoint
First-chance exception at 0x75c99617 (KernelBase.dll) in WinSTM.exe: Microsoft C++ exception: CInvalidArgException at memory location 0x001af0a4..
Warning: Uncaught exception in WindowProc (returning 1).
'WinSTM.exe': Unloaded 'C:\Windows\System32\wpdshext.dll'
'WinSTM.exe': Unloaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7600.16385_none_72fc7cbf861225ca\GdiPlus.dll'
'WinSTM.exe': Unloaded 'C:\Windows\System32\ExplorerFrame.dll'
'WinSTM.exe': Unloaded 'C:\Program Files\Common Files\microsoft shared\ink\tiptsf.dll'
The thread 'Win32 Thread' (0x884) has exited with code 0 (0x0).


Here is the code immediately before the program aborts and the debugger yells at me:
void CDocument::SetPathName(LPCTSTR lpszPathName, BOOL bAddToMRU)
{
	// store the path fully qualified
	TCHAR szFullPath[_MAX_PATH];
	ENSURE(lpszPathName);
	if ( lstrlen(lpszPathName) >= _MAX_PATH )
	{
		ASSERT(FALSE);
		// MFC requires paths with length < _MAX_PATH
		// No other way to handle the error from a void function
		AfxThrowFileException(CFileException::badPath);
	}
	if( AfxFullPath(szFullPath, lpszPathName) == FALSE )
	{
		ASSERT(FALSE);
		// MFC requires paths with length < _MAX_PATH
		// No other way to handle the error from a void function
		AfxThrowFileException(CFileException::badPath);
	}
	m_strPathName = szFullPath;
	ASSERT(!m_strPathName.IsEmpty());       // must be set to something
	m_bEmbedded = FALSE;
	ASSERT_VALID(this);
	// set the document title based on path name
	TCHAR szTitle[_MAX_FNAME];
	if (AfxGetFileTitle(szFullPath, szTitle, _MAX_FNAME) == 0)
		SetTitle(szTitle);
	// add it to the file MRU list
	if (bAddToMRU)
		AfxGetApp()->AddToRecentFileList(m_strPathName);
	ASSERT_VALID(this);
}


My gut is telling me that I have a pointer that is not returning the correct value, but I am having trouble tracking it down. Thanks for any and all help!

Best,

Andrew
AnswerRe: Runtime Error in Visual Studio Pin
Richard Andrew x6429-Jul-11 13:07
professionalRichard Andrew x6429-Jul-11 13:07 
GeneralRe: Runtime Error in Visual Studio Pin
AndrewG123129-Jul-11 13:20
AndrewG123129-Jul-11 13: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.