Click here to Skip to main content
15,920,956 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Needing noob help 7z Archive Pin
Garth J Lancaster13-Mar-09 19:41
professionalGarth J Lancaster13-Mar-09 19:41 
GeneralRe: Needing noob help 7z Archive [modified] Pin
Member 416282714-Mar-09 8:46
Member 416282714-Mar-09 8:46 
AnswerRe: Needing noob help 7z Archive Pin
NeoAks00713-Mar-09 22:22
NeoAks00713-Mar-09 22:22 
GeneralRe: Needing noob help 7z Archive Pin
Member 416282714-Mar-09 8:56
Member 416282714-Mar-09 8:56 
AnswerRe: Needing noob help 7z Archive Pin
Joe Woodbury15-Mar-09 18:07
professionalJoe Woodbury15-Mar-09 18:07 
QuestionHow to store the data into access database in MFC Pin
Febin Elizabeth13-Mar-09 18:35
Febin Elizabeth13-Mar-09 18:35 
AnswerRe: How to store the data into access database in MFC Pin
shaina223113-Mar-09 19:43
shaina223113-Mar-09 19:43 
QuestionHelp testing a CDialog based class Pin
bulg13-Mar-09 13:52
bulg13-Mar-09 13:52 
I'm having trouble using the code that MFC app-wizard spits out for a custom dialog as the base class for another few custom dialogs.

My problem is that I can't seem to write (or borrow) the simplest app possible that is able to instantiate one of my dialog classes.

I copied Nishant Sivakumar's simplest MFC app in the world, FirstProg.zip, from somewhere on the internet, which looks something like this:

//NWinApp.h
class CNWinApp  : public CWinApp
{
public:
    BOOL InitInstance();
};

//NWinApp.cpp
#include <afxwin.h>
#include "NWinApp.h"

CNWinApp app;

BOOL CNWinApp::InitInstance()
{
    CFrameWnd *pnframe=new CFrameWnd;
    m_pMainWnd=pnframe;
    pnframe->Create(0,"Buster");
    pnframe->ShowWindow(SW_SHOW);
    return TRUE;
}
</afxwin.h>


This also looks like the generic code for testing a CDialog based class generated by MFC AppWizard. I replaced the CFrameWnd bit like this

CMyGuiDlg *pGuiDlg= new CMyGuiDlg;
m_pMainWnd=pGuiDlg;
pGuiDlg->DoModal();
return TRUE;


I can compile & run this project, and nothing shows up on the screen. If I compile and run the original AppWizard-produced project, the dialog (CMyGuiDlg) will show up no problem.

I've also tried to write my own CWinApp derivation in a Win32Console App project, and got it to compile & run by calling _tWinMain(...), however my program was exiting as fast as it started.

I think I need to use CWinApp as the basis for my program, and AfxWinMain(...).
What am I missing?

Currently I have resorted to creating all the dialog derivations in the same project, so that I can use the AppWizard generated test files to run them. I had hoped I could have a different project for each derivation.
AnswerRe: Help testing a CDialog based class Pin
Iain Clarke, Warrior Programmer13-Mar-09 23:31
Iain Clarke, Warrior Programmer13-Mar-09 23:31 
QuestionInserting string and increasing file size in istream ? Pin
mmayur13-Mar-09 13:24
mmayur13-Mar-09 13:24 
AnswerRe: Inserting string and increasing file size in istream ? Pin
Stuart Dootson13-Mar-09 13:42
professionalStuart Dootson13-Mar-09 13:42 
GeneralRe: Inserting string and increasing file size in istream ? Pin
mmayur13-Mar-09 13:48
mmayur13-Mar-09 13:48 
GeneralRe: Inserting string and increasing file size in istream ? Pin
Stuart Dootson13-Mar-09 14:06
professionalStuart Dootson13-Mar-09 14:06 
Answer[Message Deleted] Pin
zzgzzgok13-Mar-09 12:56
zzgzzgok13-Mar-09 12:56 
RantRe: Hight price looking for talent c/c++ guru, Pin
CPallini13-Mar-09 13:12
mveCPallini13-Mar-09 13:12 
General[Message Deleted] Pin
zzgzzgok13-Mar-09 13:14
zzgzzgok13-Mar-09 13:14 
GeneralRe: Hight price looking for talent c/c++ guru, Pin
Yusuf13-Mar-09 13:34
Yusuf13-Mar-09 13:34 
QuestionRegular expression Pin
Demian Panello13-Mar-09 12:26
Demian Panello13-Mar-09 12:26 
AnswerRe: Regular expression Pin
BobInNJ13-Mar-09 12:44
BobInNJ13-Mar-09 12:44 
GeneralRe: Regular expression Pin
Demian Panello13-Mar-09 14:19
Demian Panello13-Mar-09 14:19 
QuestionI Think I need to free Something Pin
BobInNJ13-Mar-09 11:38
BobInNJ13-Mar-09 11:38 
AnswerRe: I Think I need to free Something Pin
Stuart Dootson13-Mar-09 13:54
professionalStuart Dootson13-Mar-09 13:54 
GeneralRe: I Think I need to free Something Pin
BobInNJ14-Mar-09 13:16
BobInNJ14-Mar-09 13:16 
GeneralRe: I Think I need to free Something Pin
Stuart Dootson14-Mar-09 13:24
professionalStuart Dootson14-Mar-09 13:24 
GeneralRe: I Think I need to free Something Pin
BobInNJ14-Mar-09 14:16
BobInNJ14-Mar-09 14:16 

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.