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

C / C++ / MFC

 
GeneralRe: Pre compiled Headers Pin
Navin27-Aug-03 16:07
Navin27-Aug-03 16:07 
GeneralRe: Pre compiled Headers Pin
Steve S27-Aug-03 22:55
Steve S27-Aug-03 22:55 
GeneralMicrosoft 'C' Compiler 6.00 Pin
C. Augusto Proiete27-Aug-03 13:35
C. Augusto Proiete27-Aug-03 13:35 
GeneralRe: Microsoft 'C' Compiler 6.00 Pin
Steve S27-Aug-03 22:49
Steve S27-Aug-03 22:49 
GeneralRe: Microsoft 'C' Compiler 6.00 Pin
C. Augusto Proiete28-Aug-03 3:39
C. Augusto Proiete28-Aug-03 3:39 
Generalpass complex data type from CMyapp to CMyDoc (std MFC stuf) Pin
Member 53141427-Aug-03 12:54
Member 53141427-Aug-03 12:54 
GeneralRe: pass complex data type from CMyapp to CMyDoc (std MFC stuf) Pin
Ravi Bhavnani27-Aug-03 13:12
professionalRavi Bhavnani27-Aug-03 13:12 
GeneralRe: pass complex data type from CMyapp to CMyDoc (std MFC stuf) Pin
Antti Keskinen16-Feb-04 3:04
Antti Keskinen16-Feb-04 3:04 
You have a few options available.

As the structure exists in the application class (CMyApp), you can create a member function that returns the address of this structure.

Now, if this method is called from inside CMyDoc, the document has the address of the structure, and can operate on it freely, providing that both objects reside on the same thread. If they do not, things get more complicated.

Alternatively, taking an advanced step from the section above, you can create a structure into CMyDoc as well, then get a pointer from CMyApp and use memcpy to copy the structure data from CMyApp to CMyDoc. Now, CMyDoc contains a copy of the structure.

The previous posted created an example piece to show you how to access the application object at run-time. Use this method to call the function that returns the structure address.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralAssertion error at CDialog dereived class constructor Pin
Vassilis Papoulidis27-Aug-03 12:47
Vassilis Papoulidis27-Aug-03 12:47 
GeneralRe: Assertion error at CDialog dereived class constructor Pin
valikac27-Aug-03 12:51
valikac27-Aug-03 12:51 
GeneralRe: Assertion error at CDialog dereived class constructor Pin
Dave Bryant27-Aug-03 12:57
Dave Bryant27-Aug-03 12:57 
Generalkeybd_event question Pin
halblonious27-Aug-03 11:53
halblonious27-Aug-03 11:53 
QuestionWhat is a game engine?? Pin
Snyp27-Aug-03 10:09
Snyp27-Aug-03 10:09 
AnswerRe: What is a game engine?? Pin
Jim Crafton27-Aug-03 10:21
Jim Crafton27-Aug-03 10:21 
AnswerRe: What is a game engine?? Pin
Maximilien27-Aug-03 10:26
Maximilien27-Aug-03 10:26 
GeneralASSERT failure Pin
mr200327-Aug-03 9:13
mr200327-Aug-03 9:13 
GeneralRe: ASSERT failure Pin
David Crow27-Aug-03 9:53
David Crow27-Aug-03 9:53 
GeneralRe: ASSERT failure Pin
mr200327-Aug-03 10:11
mr200327-Aug-03 10:11 
GeneralRe: ASSERT failure Pin
David Crow27-Aug-03 10:19
David Crow27-Aug-03 10:19 
GeneralRe: ASSERT failure Pin
mr200327-Aug-03 16:17
mr200327-Aug-03 16:17 
GeneralRe: ASSERT failure Pin
David Crow28-Aug-03 2:11
David Crow28-Aug-03 2:11 
GeneralRe: ASSERT failure Pin
Alvaro Mendez27-Aug-03 10:00
Alvaro Mendez27-Aug-03 10:00 
GeneralRe: ASSERT failure Pin
WebmastaX27-Aug-03 11:29
WebmastaX27-Aug-03 11:29 
GeneralRe: ASSERT failure Pin
vcplusplus27-Aug-03 12:27
vcplusplus27-Aug-03 12:27 
GeneralActive Reports VC++ Implementation Guide Pin
Miguel Lopes27-Aug-03 8:57
Miguel Lopes27-Aug-03 8:57 

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.