Click here to Skip to main content
16,011,538 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to use the struct in the VC.Net? Pin
greenwyx30-Aug-05 22:02
greenwyx30-Aug-05 22:02 
AnswerRe: How to use the struct in the VC.Net? Pin
toxcct30-Aug-05 22:17
toxcct30-Aug-05 22:17 
GeneralRe: How to use the struct in the VC.Net? Pin
greenwyx30-Aug-05 22:49
greenwyx30-Aug-05 22:49 
GeneralRe: How to use the struct in the VC.Net? Pin
toxcct30-Aug-05 22:54
toxcct30-Aug-05 22:54 
GeneralRe: How to use the struct in the VC.Net? Pin
greenwyx30-Aug-05 23:02
greenwyx30-Aug-05 23:02 
GeneralRe: How to use the struct in the VC.NET [edited] Pin
toxcct30-Aug-05 23:09
toxcct30-Aug-05 23:09 
GeneralRe: How to use the struct in the VC.Net? Pin
greenwyx30-Aug-05 23:16
greenwyx30-Aug-05 23:16 
GeneralRe: How to use the struct in the VC.Net? Pin
Cedric Moonen30-Aug-05 23:13
Cedric Moonen30-Aug-05 23:13 
Ok, so let's start from the begining.

First, you have to declare your structure (that is how it will look like: what are the members). Then when it's done (and only when it's done) you can 'instantiate' a structure like that (that is, you can make use of it as a new instance).

In order to instantiate the structure, the compiler needs to know how it looks like, so it has to be defined before. Put the definition of the structure above the definition Cview class (him, also, this is not a good naming convention, I suggest to name your view class with a name more appropriate, something like CMyView). Then, inside your class, you can declare an instance of this structure:

ScreenStruct m_Screen;

Why do you want to use a pointer ? Do you need more than one (so you need a table of structure) ? If you just need one struct, use this solution instead otherwise you will need to initialize yout table wlike that:

m_Screen = new ScreenStruct[10];
and then delete the memroy afterward (in the destructor of your Cview class for example).
General[Message Deleted] Pin
Cedric Moonen30-Aug-05 23:13
Cedric Moonen30-Aug-05 23:13 
GeneralRe: How to use the struct in the VC.Net? Pin
greenwyx30-Aug-05 23:20
greenwyx30-Aug-05 23:20 
GeneralRe: How to use the struct in the VC.Net? Pin
greenwyx30-Aug-05 23:06
greenwyx30-Aug-05 23:06 
AnswerRe: How to use the struct in the VC.Net? Pin
Marc Soleda30-Aug-05 22:52
Marc Soleda30-Aug-05 22:52 
GeneralRe: How to use the struct in the VC.Net? Pin
greenwyx30-Aug-05 22:55
greenwyx30-Aug-05 22:55 
GeneralRe: How to use the struct in the VC.Net? Pin
GDavy30-Aug-05 23:09
GDavy30-Aug-05 23:09 
GeneralRe: How to use the struct in the VC.Net? Pin
Marc Soleda30-Aug-05 23:21
Marc Soleda30-Aug-05 23:21 
GeneralRe: How to use the struct in the VC.Net? Pin
greenwyx30-Aug-05 23:35
greenwyx30-Aug-05 23:35 
GeneralRe: How to use the struct in the VC.Net? Pin
Marc Soleda30-Aug-05 23:52
Marc Soleda30-Aug-05 23:52 
GeneralRe: How to use the struct in the VC.Net? Pin
toxcct31-Aug-05 0:01
toxcct31-Aug-05 0:01 
NewsWritng a VC++ Code to lock a windows File Pin
Its_Me_Shashank30-Aug-05 21:54
Its_Me_Shashank30-Aug-05 21:54 
QuestionHook expert needed : add event to JournalPlaybackProc -> i m lost ! Pin
etherny30-Aug-05 21:45
etherny30-Aug-05 21:45 
QuestionHow to dynamically load powerpoint into my MFC application? Pin
Amarelia30-Aug-05 20:30
Amarelia30-Aug-05 20:30 
AnswerRe: How to dynamically load powerpoint into my MFC application? Pin
sharpanil30-Aug-05 20:49
sharpanil30-Aug-05 20:49 
AnswerRe: How to dynamically load powerpoint into my MFC application? Pin
Eytukan30-Aug-05 22:31
Eytukan30-Aug-05 22:31 
QuestionEvent watching Pin
Nishad S30-Aug-05 19:55
Nishad S30-Aug-05 19:55 
AnswerRe: Event watching Pin
prasad_som30-Aug-05 20:18
prasad_som30-Aug-05 20:18 

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.