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

C / C++ / MFC

 
GeneralGetting shldisp.h Pin
Ravi Shankar27-Jun-02 1:35
Ravi Shankar27-Jun-02 1:35 
GeneralRe: Getting shldisp.h Pin
Ramu Pulipati27-Jun-02 1:57
Ramu Pulipati27-Jun-02 1:57 
GeneralCRecordset - Retrieving SQL & Parameters on Fail Pin
Henry Kafeman27-Jun-02 1:02
Henry Kafeman27-Jun-02 1:02 
GeneralRe: CRecordset - Retrieving SQL & Parameters on Fail Pin
Bill Wilson27-Jun-02 10:04
Bill Wilson27-Jun-02 10:04 
GeneralRe: CRecordset - Retrieving SQL & Parameters on Fail Pin
Carlos Antollini27-Jun-02 10:24
Carlos Antollini27-Jun-02 10:24 
GeneralRe: CRecordset - Retrieving SQL & Parameters on Fail Pin
Alexandru Savescu27-Jun-02 10:55
Alexandru Savescu27-Jun-02 10:55 
GeneralRe: CRecordset - Clarification Pin
Henry Kafeman28-Jun-02 3:22
Henry Kafeman28-Jun-02 3:22 
GeneralWindows Programming Question Pin
Alan Chambers27-Jun-02 0:29
Alan Chambers27-Jun-02 0:29 
Hi all, I am in a bit of a Dilemma. My app currently takes the format:

Declare Globals.
function InitApp().
function UpdateFrame().
function CallBack WindowProc().
function WinMain().

I would like to incorporate a CD3DApp class which WinMain() would create, initialise and set the Run() function. The CD3DApp class would then handle its own messages in a similar style to the code:

while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
ProcessMessage(&msg);
}

which obviously uses the WindowProc CallBack function (so I could specify which buttons do what etc.). I DO NOT want to use MFC. I would like to make my InitApp(), UpdateFrame() and Run() a part of the CD3DApp class and also the global variables as member variables (I think the code is much cleaner then). However, if I put the messaging code listed above in the Run() the CallBack WindowProc cannot access the member variables of the CD3DApp class because the object hasn't been passed through to it (whereas before they were global which allowed for access). There is a timer in the WindowProc which is used to create an animation, which is why I would like access to the CD3DApp class.

What I would like to know is:

1.) Is there any way of creating a class that has its own WindowProc function, so that it can access the member variables?

2.) If not, is there any better way to go about solving this problem of getting the code cleaner (losing the globals)?

"When I left you I was but the learner, now I am the master" - Darth Vader
GeneralRe: Windows Programming Question Pin
Michael P Butler27-Jun-02 0:38
Michael P Butler27-Jun-02 0:38 
GeneralRe: Windows Programming Question Pin
Alan Chambers27-Jun-02 0:52
Alan Chambers27-Jun-02 0:52 
GeneralRe: Windows Programming Question Pin
Michael P Butler27-Jun-02 1:07
Michael P Butler27-Jun-02 1:07 
GeneralRe: Windows Programming Question Pin
Alan Chambers27-Jun-02 1:36
Alan Chambers27-Jun-02 1:36 
QuestionHow strange are these problems? Pin
Alan Chambers27-Jun-02 0:28
Alan Chambers27-Jun-02 0:28 
GeneralScrollView Problem Pin
LittleYellowBird27-Jun-02 0:09
LittleYellowBird27-Jun-02 0:09 
GeneralRe: ScrollView Problem Pin
Rage27-Jun-02 1:58
professionalRage27-Jun-02 1:58 
GeneralRe: ScrollView Problem Pin
Roger Allen27-Jun-02 2:11
Roger Allen27-Jun-02 2:11 
GeneralRe: ScrollView Problem Pin
LittleYellowBird27-Jun-02 4:19
LittleYellowBird27-Jun-02 4:19 
GeneralRe: ScrollView Problem Pin
Roger Allen27-Jun-02 2:16
Roger Allen27-Jun-02 2:16 
Generaldial-up networking Pin
slah27-Jun-02 0:04
slah27-Jun-02 0:04 
GeneralRe: dial-up networking Pin
Bill Wilson27-Jun-02 10:07
Bill Wilson27-Jun-02 10:07 
QuestionHow to allocate additional space with new Object[]? Pin
Tommy Svensson26-Jun-02 23:54
Tommy Svensson26-Jun-02 23:54 
AnswerRe: How to allocate additional space with new Object[]? Pin
Christian Graus27-Jun-02 0:04
protectorChristian Graus27-Jun-02 0:04 
GeneralRe: How to allocate additional space with new Object[]? Pin
Rage27-Jun-02 2:00
professionalRage27-Jun-02 2:00 
GeneralRe: How to allocate additional space with new Object[]? Pin
Christian Graus27-Jun-02 2:20
protectorChristian Graus27-Jun-02 2:20 
GeneralRe: How to allocate additional space with new Object[]? Pin
Rage27-Jun-02 2:47
professionalRage27-Jun-02 2:47 

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.