Click here to Skip to main content
15,891,828 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Best way to setup environment for modular development ? Pin
Blake Miller26-Apr-06 7:25
Blake Miller26-Apr-06 7:25 
AnswerRe: Best way to setup environment for modular development ? Pin
Rilhas29-Apr-06 15:06
Rilhas29-Apr-06 15:06 
QuestionHandling asynchronous I/O Pin
logicaldna26-Apr-06 6:24
logicaldna26-Apr-06 6:24 
QuestionCTreeCtrl selection problem Pin
RoyceF26-Apr-06 5:57
RoyceF26-Apr-06 5:57 
AnswerRe: CTreeCtrl selection problem Pin
includeh1026-Apr-06 6:16
includeh1026-Apr-06 6:16 
GeneralRe: CTreeCtrl selection problem Pin
RoyceF26-Apr-06 7:15
RoyceF26-Apr-06 7:15 
GeneralRe: CTreeCtrl selection problem Pin
RoyceF26-Apr-06 7:17
RoyceF26-Apr-06 7:17 
QuestionCFileDialog & GetOpenFileName Pin
RobJones26-Apr-06 5:24
RobJones26-Apr-06 5:24 
Hello,
I am still stuck on something I posted a question about a couple of weeks ago (I thought I figured it out but that isn't the case). I am using VC++ 2003 .NET. I believe that I did install the Windows 2003 Server SDK but I am not sure how I can tell, I don't see it listed in add-remove programs nor under updates.

Anyway, I have tried to use both CFileDialog and GetOpenFileName and both cause a First-chance exception. The exception doesn't happen the first time the file dialog is displayed but it will always happen the 2nd time its displayed. The error is listed below. I have done tons of research on the net and it appears that a lot of other people are having the same problem but I havent seen any resolutions that actually work (most suggest its a problem caused by the Windows 2003 Server SDK).

Heres the error:
First-chance exception at 0x7ca51406 in SiteConsole.exe: 
0xC0000005: 
Access violation reading location 0x016d4980.

Debugging hasn't lead me anywhere...

Heres the code: it's pretty straight forward.
void CExcludeDlg::OnBnClickedBImport()
{
	UpdateData(TRUE);

/* I can use either GetOpenFileName or CFileDialog and both cause the exception.
	OPENFILENAME ofn;
	TCHAR pszFile[MAX_PATH*2];

	_tcscpy(pszFile, _T("") );
	memset(&ofn, 0, sizeof(ofn));

	ofn.lStructSize = sizeof(ofn);    // I think this is the problem because of the SDK
	ofn.hwndOwner	= GetSafeHwnd();
	ofn.lpstrFile	= pszFile;
	ofn.nMaxFile	= sizeof(pszFile);
	ofn.Flags		= OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NONETWORKBUTTON | OFN_FILEMUSTEXIST;
	ofn.lpstrFilter = _T("All Files (*.*)\0*.*\0Executables (*.exe;*.ocx;*.dll)\0*.exe;*.ocx;*.dll\0");
	ofn.lpstrTitle	= _T("Please select a file");

	if (GetOpenFileName( &ofn ))
	{
		// I don't have to do anything it will still crash.
	}
*/	
	static char BASED_CODE szFilter[] = _T("Text File (*.txt)|*.txt||");
	CFileDialog m_ldFile(TRUE, _T(".txt"), NULL, OFN_HIDEREADONLY, szFilter);
	if (m_ldFile.DoModal() == IDOK)
	{
		// I don't have to do anything it will still crash.
	}

	UpdateData(FALSE);
}


On a side note how can I uninstall windows 2003 server SDK? This may fix the problem.

Thanks!
Rob

Whoever said nothing's impossible never tried slamming a revolving door!
QuestionRe: CFileDialog & GetOpenFileName Pin
David Crow26-Apr-06 6:06
David Crow26-Apr-06 6:06 
AnswerRe: CFileDialog & GetOpenFileName Pin
RobJones26-Apr-06 6:18
RobJones26-Apr-06 6:18 
AnswerRe: CFileDialog & GetOpenFileName Pin
RobJones26-Apr-06 6:42
RobJones26-Apr-06 6:42 
AnswerRe: CFileDialog & GetOpenFileName Pin
RobJones26-Apr-06 7:16
RobJones26-Apr-06 7:16 
AnswerRe: CFileDialog & GetOpenFileName Pin
RobJones26-Apr-06 7:58
RobJones26-Apr-06 7:58 
QuestionRe: CFileDialog & GetOpenFileName Pin
David Crow27-Apr-06 2:45
David Crow27-Apr-06 2:45 
GeneralRe: CFileDialog & GetOpenFileName Pin
David Crow27-Apr-06 9:41
David Crow27-Apr-06 9:41 
GeneralRe: CFileDialog & GetOpenFileName Pin
RobJones27-Apr-06 9:50
RobJones27-Apr-06 9:50 
GeneralRe: CFileDialog & GetOpenFileName Pin
RobJones1-May-06 3:55
RobJones1-May-06 3:55 
QuestionSystem sound volume on WinCE Pin
KellyR26-Apr-06 5:15
KellyR26-Apr-06 5:15 
QuestionJPEG image display Pin
CPP91126-Apr-06 4:52
CPP91126-Apr-06 4:52 
AnswerRe: JPEG image display Pin
Russell'26-Apr-06 5:08
Russell'26-Apr-06 5:08 
AnswerRe: JPEG image display Pin
KellyR26-Apr-06 5:12
KellyR26-Apr-06 5:12 
AnswerRe: JPEG image display Pin
Hamid_RT26-Apr-06 18:46
Hamid_RT26-Apr-06 18:46 
QuestionYour comments for Font-Editor Pin
includeh1026-Apr-06 4:47
includeh1026-Apr-06 4:47 
Questiondraw a thin line with anti-aliasing as Font! Pin
includeh1026-Apr-06 4:43
includeh1026-Apr-06 4:43 
AnswerRe: draw a thin line with anti-aliasing as Font! Pin
Shog926-Apr-06 17:53
sitebuilderShog926-Apr-06 17:53 

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.