Click here to Skip to main content
15,919,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Roger Allen27-Jun-02 3:43
Roger Allen27-Jun-02 3:43 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Mohit Khanna27-Jun-02 22:56
Mohit Khanna27-Jun-02 22:56 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Roger Allen27-Jun-02 23:08
Roger Allen27-Jun-02 23:08 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Mohit Khanna27-Jun-02 23:34
Mohit Khanna27-Jun-02 23:34 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Roger Allen28-Jun-02 0:21
Roger Allen28-Jun-02 0:21 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Mohit Khanna28-Jun-02 0:50
Mohit Khanna28-Jun-02 0:50 
Generalconnecting to a remote database Pin
Sam197927-Jun-02 1:50
Sam197927-Jun-02 1:50 
GeneralRe: connecting to a remote database Pin
Le centriste27-Jun-02 5:19
Le centriste27-Jun-02 5:19 
GeneralRe: connecting to a remote database Pin
Mike Nordell28-Jun-02 9:35
Mike Nordell28-Jun-02 9:35 
GeneralAbout memory leaks Pin
Rage27-Jun-02 1:47
professionalRage27-Jun-02 1:47 
GeneralRe: About memory leaks Pin
Ramu Pulipati27-Jun-02 2:01
Ramu Pulipati27-Jun-02 2:01 
GeneralRe: About memory leaks Pin
Rage27-Jun-02 2:19
professionalRage27-Jun-02 2:19 
GeneralRe: About memory leaks Pin
Christian Graus27-Jun-02 2:21
protectorChristian Graus27-Jun-02 2:21 
GeneralRe: About memory leaks Pin
Frank Driesens27-Jun-02 2:40
Frank Driesens27-Jun-02 2:40 
GeneralRe: About memory leaks Pin
Rage27-Jun-02 2:55
professionalRage27-Jun-02 2:55 
GeneralRe: About memory leaks Pin
LittleYellowBird27-Jun-02 4:33
LittleYellowBird27-Jun-02 4:33 
GeneralRe: About memory leaks Pin
Rage27-Jun-02 4:51
professionalRage27-Jun-02 4:51 
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

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.