Click here to Skip to main content
15,902,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error C2051: case expression not constant Pin
Cuziyq7-Aug-07 9:01
Cuziyq7-Aug-07 9:01 
GeneralRe: error C2051: case expression not constant Pin
Mark Salsbery7-Aug-07 9:17
Mark Salsbery7-Aug-07 9:17 
GeneralRe: error C2051: case expression not constant Pin
led mike7-Aug-07 9:33
led mike7-Aug-07 9:33 
GeneralRe: error C2051: case expression not constant Pin
Mark Salsbery7-Aug-07 9:37
Mark Salsbery7-Aug-07 9:37 
GeneralRe: error C2051: case expression not constant Pin
led mike7-Aug-07 10:16
led mike7-Aug-07 10:16 
AnswerRe: error C2051: case expression not constant Pin
David Crow7-Aug-07 8:48
David Crow7-Aug-07 8:48 
QuestionAfxGetResourceHandle() assertion failure on LoadFrame() Pin
p_4737-Aug-07 7:28
p_4737-Aug-07 7:28 
AnswerRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
Mark Salsbery7-Aug-07 7:55
Mark Salsbery7-Aug-07 7:55 
p_473 wrote:
using a CFrameWnd into my existing application, which, however, is an ATL
one

I only had to read that far. 

If you're going to use MFC classes then, except for a (very) few classes, you need to use an MFC application.

It is possible to get around this, but whether it's portable to future versions or not, I don't know.

Here's some of the issues:

1) Initialization.  The MFC library needs to be initialized.  The one-and-only CWinApp object is part of this.
You'll need that object even if you don't use its message pump.  You'll also need to call AfxInitialize() and/or
AfxWinInit().  From the AfxWinInit() docs:

"If you call AfxWinInit yourself, you should declare an instance of a CWinApp class. For a console application,
you might choose not to derive your own class from CWinApp and instead use an instance of CWinApp directly.
This technique is appropriate if you decide to leave all functionality for your application in your implementation of main.
"

2) Window messages.  If you're using a message loop outside of the MFC framework, then you need to pass all unhandled
messages to the MFC framework from your message loop.  You can do this by passing them to your CWinApp object's
PreTranslateMessage() method.

Hope this helps a bit.

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
p_4738-Aug-07 6:37
p_4738-Aug-07 6:37 
GeneralRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
Mark Salsbery8-Aug-07 7:17
Mark Salsbery8-Aug-07 7:17 
QuestionRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
p_4739-Aug-07 6:31
p_4739-Aug-07 6:31 
AnswerRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
Mark Salsbery9-Aug-07 6:46
Mark Salsbery9-Aug-07 6:46 
GeneralRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
p_4739-Aug-07 21:30
p_4739-Aug-07 21:30 
GeneralRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
Mark Salsbery10-Aug-07 4:49
Mark Salsbery10-Aug-07 4:49 
GeneralRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
p_47310-Aug-07 7:53
p_47310-Aug-07 7:53 
QuestionRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
p_47311-Aug-07 1:24
p_47311-Aug-07 1:24 
QuestionRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
p_47315-Aug-07 4:57
p_47315-Aug-07 4:57 
AnswerRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
Mark Salsbery15-Aug-07 5:23
Mark Salsbery15-Aug-07 5:23 
QuestionRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
p_47324-Aug-07 7:50
p_47324-Aug-07 7:50 
QuestionRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
p_47327-Aug-07 6:17
p_47327-Aug-07 6:17 
GeneralRe: AfxGetResourceHandle() assertion failure on LoadFrame() Pin
pbor17-Aug-08 21:40
pbor17-Aug-08 21:40 
Questioni need to use a ddk Pin
javad_20057-Aug-07 6:13
javad_20057-Aug-07 6:13 
AnswerRe: i need to use a ddk Pin
Sam_c7-Aug-07 6:42
Sam_c7-Aug-07 6:42 
QuestionSimilar Images Pin
Maynka7-Aug-07 4:03
Maynka7-Aug-07 4:03 
AnswerRe: Similar Images Pin
led mike7-Aug-07 4:42
led mike7-Aug-07 4:42 

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.