Click here to Skip to main content
15,918,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSetButtonInfo parameter Pin
Abhi Lahare25-May-06 4:33
Abhi Lahare25-May-06 4:33 
Questionstrange compiler's error Pin
NoName II25-May-06 3:59
NoName II25-May-06 3:59 
AnswerRe: strange compiler's error Pin
Chris Losinger25-May-06 4:01
professionalChris Losinger25-May-06 4:01 
AnswerRe: strange compiler's error Pin
Zac Howland25-May-06 6:31
Zac Howland25-May-06 6:31 
GeneralRe: strange compiler's error Pin
Steve S25-May-06 22:12
Steve S25-May-06 22:12 
GeneralRe: strange compiler's error Pin
Zac Howland26-May-06 4:32
Zac Howland26-May-06 4:32 
QuestionHelp Needed on DirectShow (very urgent) Pin
atimpoo25-May-06 3:29
atimpoo25-May-06 3:29 
QuestionError accessing CWinApp object in Win32 application Pin
Cyber Friend25-May-06 2:34
Cyber Friend25-May-06 2:34 
Hi,
I have built an win32 applicaion in which i m using global functions n no classes. I want to open a CFileDialog in the applicaion but i m not able to get CWnd *m_pMainWnd member of the application, which is required to initialize CFileDialog object.

When in Winmain function of my application I write this
/////////////////////////////////////////////////
CWinApp* app=AfxGetApp();
ASSERT(app!=NULL); // app is NULL when I check in Debug window
pWnd=app->m_pMainWnd; // CWnd *pWnd , global variable
//////////////////////////////////////////////////////////////////////

It generates a Debug Assertion Failed message.
Can any one suggest a solution.

I need the CWnd variable for CFileDialg in function and want to pass it to the function instead fo HWND hWnd.
/////////////////////////////////////////////////////////////////////////////
void LoadXmlFile(HWND hWnd)
{
CString strFileName;
char szFilters[]= "XML Files (*.xml)|*.xml";
CString str;

CFileDialog fileDlg(true,0,0,OFN_FILEMUSTEXIST| READONLY,szFilters ,(CWnd*)hWnd );

.....................
}
//////////////////////////////////////////////////////////////////////
I ll appreciate if anyone helps.
Thanx in anticipation.


Cyber Friend
AnswerRe: Error accessing CWinApp object in Win32 application Pin
Chris Meech25-May-06 3:09
Chris Meech25-May-06 3:09 
AnswerRe: Error accessing CWinApp object in Win32 application Pin
NiceNaidu25-May-06 3:09
NiceNaidu25-May-06 3:09 
AnswerRe: Error accessing CWinApp object in Win32 application Pin
Hamid_RT25-May-06 3:30
Hamid_RT25-May-06 3:30 
AnswerRe: Error accessing CWinApp object in Win32 application Pin
Hans Ruck25-May-06 4:49
Hans Ruck25-May-06 4:49 
AnswerRe: Error accessing CWinApp object in Win32 application Pin
Zac Howland25-May-06 5:23
Zac Howland25-May-06 5:23 
AnswerRe: Error accessing CWinApp object in Win32 application Pin
Cyber Friend28-May-06 23:20
Cyber Friend28-May-06 23:20 
QuestionRegrading HTTP Digest Authentication Pin
mohsin_m25-May-06 2:31
mohsin_m25-May-06 2:31 
QuestionMinimze the Application on Close (Cross) Button Pin
zahid_ash25-May-06 2:29
zahid_ash25-May-06 2:29 
AnswerRe: Minimze the Application on Close (Cross) Button Pin
Naveen25-May-06 2:34
Naveen25-May-06 2:34 
AnswerRe: Minimze the Application on Close (Cross) Button Pin
NiceNaidu25-May-06 2:55
NiceNaidu25-May-06 2:55 
AnswerRe: Minimze the Application on Close (Cross) Button Pin
ThatsAlok25-May-06 19:25
ThatsAlok25-May-06 19:25 
QuestionSorting order in folders (shell) Pin
Alkanavt25-May-06 2:21
Alkanavt25-May-06 2:21 
AnswerRe: Sorting order in folders (shell) Pin
Michael Dunn25-May-06 6:54
sitebuilderMichael Dunn25-May-06 6:54 
QuestionASCII Conversion Pin
satsumatable25-May-06 1:51
satsumatable25-May-06 1:51 
AnswerRe: ASCII Conversion Pin
NiceNaidu25-May-06 2:26
NiceNaidu25-May-06 2:26 
AnswerRe: ASCII Conversion Pin
Naveen25-May-06 2:32
Naveen25-May-06 2:32 
GeneralRe: ASCII Conversion Pin
satsumatable25-May-06 2:48
satsumatable25-May-06 2:48 

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.