Click here to Skip to main content
15,911,139 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: RegEnumValue() returns garbage value for DWORD and BINARY Datatype! Pin
Supriya Tonape18-Oct-08 23:21
Supriya Tonape18-Oct-08 23:21 
QuestionRe: RegEnumValue() returns garbage value for DWORD and BINARY Datatype! Pin
CPallini19-Oct-08 10:39
mveCPallini19-Oct-08 10:39 
AnswerRe: RegEnumValue() returns garbage value for DWORD and BINARY Datatype! Pin
Supriya Tonape21-Oct-08 1:26
Supriya Tonape21-Oct-08 1:26 
GeneralRe: RegEnumValue() returns garbage value for DWORD and BINARY Datatype! Pin
CPallini21-Oct-08 1:53
mveCPallini21-Oct-08 1:53 
QuestionUsing activex controls Pin
Rhett860616-Oct-08 10:45
Rhett860616-Oct-08 10:45 
Question_beginthread vs _beginthreadex -- FYI Pin
bulg16-Oct-08 10:34
bulg16-Oct-08 10:34 
AnswerRe: _beginthread vs _beginthreadex -- FYI Pin
Mark Salsbery16-Oct-08 10:44
Mark Salsbery16-Oct-08 10:44 
QuestionA Very Simple MFC Application Pin
BobInNJ16-Oct-08 7:57
BobInNJ16-Oct-08 7:57 
Below is what is suppose to be a valid but minimal MFC Application using SDI. It consists of
two files, the first is a header file, the second is a C++ file.

Header File

#define IDR_MAINFRAME 100

class MainApp : public CWinApp {
public:
	virtual BOOL InitInstance();
};


C++ File
#include <afxwin.h>
#include "Main.h"

#define OEMRESOURCE

MainApp myApp;

class MyDocument : public CDocument {
	DECLARE_DYNCREATE( MyDocument )
};

IMPLEMENT_DYNCREATE( MyDocument, CDocument )

class MyView : public CView {
	DECLARE_DYNCREATE( MyView )
protected:
	void OnDraw(CDC *);
};

IMPLEMENT_DYNCREATE( MyView, CView )

void
MyView::OnDraw(CDC *pDC)
{
}

BOOL
MainApp::InitInstance ()
{
    SetRegistryKey (TEXT("Programming Windows 95 with MFC"));
    LoadStdProfileSettings ();

    CSingleDocTemplate* pDocTemplate;
    pDocTemplate = new CSingleDocTemplate (
        IDR_MAINFRAME,
        RUNTIME_CLASS (CDocument),
        RUNTIME_CLASS (CFrameWnd),
        RUNTIME_CLASS (MyView)
    );
    AddDocTemplate (pDocTemplate);
    RegisterShellFileTypes (TRUE);

    CCommandLineInfo cmdInfo;
    ParseCommandLine (cmdInfo);

    if (!ProcessShellCommand (cmdInfo))
        return FALSE;

    m_pMainWnd->DragAcceptFiles ();

    return TRUE;
}


However, when I compile and run it, it dies in the call to DragAcceptFiles. I do not understand why. I am hoping that somebody here can tell me what is wrong, or the best way to debug this program.

Thanks
Bob
AnswerRe: A Very Simple MFC Application Pin
led mike16-Oct-08 8:08
led mike16-Oct-08 8:08 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 9:54
BobInNJ16-Oct-08 9:54 
AnswerRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 8:30
Mark Salsbery16-Oct-08 8:30 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:06
BobInNJ16-Oct-08 10:06 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 10:19
Mark Salsbery16-Oct-08 10:19 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:38
BobInNJ16-Oct-08 10:38 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 10:42
Mark Salsbery16-Oct-08 10:42 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:47
BobInNJ16-Oct-08 10:47 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 10:53
Mark Salsbery16-Oct-08 10:53 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 10:58
Mark Salsbery16-Oct-08 10:58 
GeneralRe: A Very Simple MFC Application Pin
led mike16-Oct-08 11:24
led mike16-Oct-08 11:24 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 11:48
Mark Salsbery16-Oct-08 11:48 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 11:26
BobInNJ16-Oct-08 11:26 
QuestionRe: A Very Simple MFC Application Pin
David Crow16-Oct-08 10:35
David Crow16-Oct-08 10:35 
AnswerRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:42
BobInNJ16-Oct-08 10:42 
QuestionRe: A Very Simple MFC Application Pin
David Crow16-Oct-08 10:45
David Crow16-Oct-08 10:45 
AnswerRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:48
BobInNJ16-Oct-08 10: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.