Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: dev-c++ to "call" another program Pin
Pranit Kothari5-Nov-11 1:57
Pranit Kothari5-Nov-11 1:57 
GeneralRe: dev-c++ to "call" another program Pin
RealHigh5-Nov-11 3:10
RealHigh5-Nov-11 3:10 
GeneralRe: dev-c++ to "call" another program Pin
Chuck O'Toole5-Nov-11 3:24
Chuck O'Toole5-Nov-11 3:24 
GeneralRe: dev-c++ to "call" another program Pin
Pranit Kothari5-Nov-11 3:32
Pranit Kothari5-Nov-11 3:32 
GeneralRe: dev-c++ to "call" another program Pin
RealHigh5-Nov-11 10:39
RealHigh5-Nov-11 10:39 
GeneralRe: dev-c++ to "call" another program PinPopular
Chuck O'Toole5-Nov-11 3:05
Chuck O'Toole5-Nov-11 3:05 
GeneralRe: dev-c++ to "call" another program Pin
RealHigh5-Nov-11 10:35
RealHigh5-Nov-11 10:35 
QuestionHow do you model your documents? Pin
Fernando A. Gomez F.4-Nov-11 9:43
Fernando A. Gomez F.4-Nov-11 9:43 
Hello all.

In all the time I have worked with C++ / MFC I have usually created data-centric applications, so I'm full with apps using ATL OleDB and the ODBC classes (CRecordset et. al.). So, I usually simply bypass the CDocument, or store small ammounts of info there (like the current user's ID and encrypted connection strings).

This time, however, I've been instructed to build a full doc-view application, with all the bells and whistles. It's kinda a internal product, so it will be a desktop app with no connectivity, and the files the app generates must be shared to other users. So, a doc-view app.

I've been wondering, however, how to create the data model. I mean, I created a base class that inherits from CObject, implements serialization and has a GUID as a property and such. Then my model classes inherit from this one. Some of this classes have collections of another one as their child, and so on. Say:

C++
class CEntity : public CObject
{
    //...etc...
    CGuid GetId() const; // CGuid encapsulates GUID and the ::Unique<something> set of functions.
};

class CContact : public CEntity
{
    // ...etc...
};

class CMeeting : public CEntity
{
    // ...etc...
    CArray<CContact*> m_objParticipants;
};


Here the thing is that a CContact object can be used elsewhere, so it is not owned by the CMeeting. So, I'm guessing that the CContact collection should be created in the CDocument-derived class, and so the CMeeting one should have only references to a) the CDocument and b) the contact's CGuid, so that it can search for the actual pointer when needed. This would mean that CDocument should have to serialize the object rather than CMeeting, and I'm thinking CMeeting should only serialize the CGuid value... or something similar.

Yet... it doesn't feel quite right, and I'm rather confused as to which approach to use. So, I was wondering if you CPians could help me with advises, experiencies and how you solved similar problems. Any comment will be really appreciated.

Cheers and thanks in advance.
QuestionHow to remove 'The publisher could not be verified. Are you sure you want to run this software?' Pin
DanYELL4-Nov-11 6:48
DanYELL4-Nov-11 6:48 
AnswerRe: How to remove 'The publisher could not be verified. Are you sure you want to run this software?' Pin
Software_Developer4-Nov-11 8:20
Software_Developer4-Nov-11 8:20 
QuestionIShellFolder2::GetDetailsOf method not find details of 2007 and upper MS office files. Pin
Le@rner4-Nov-11 0:28
Le@rner4-Nov-11 0:28 
Question"using system" generates "undeclared" error. _outp also. Pin
RealHigh3-Nov-11 7:38
RealHigh3-Nov-11 7:38 
AnswerRe: "using system" generates "undeclared" error. _outp also. Pin
Goto_Label_3-Nov-11 8:22
Goto_Label_3-Nov-11 8:22 
GeneralRe: "using system" generates "undeclared" error. _outp also. Pin
RealHigh4-Nov-11 8:39
RealHigh4-Nov-11 8:39 
QuestionRe: "using system" generates "undeclared" error. _outp also. Pin
David Crow3-Nov-11 9:49
David Crow3-Nov-11 9:49 
AnswerRe: "using system" generates "undeclared" error. _outp also. Pin
RealHigh4-Nov-11 8:45
RealHigh4-Nov-11 8:45 
QuestionWhy DrawText() fails? Pin
RS.Ratheesh3-Nov-11 4:03
RS.Ratheesh3-Nov-11 4:03 
QuestionRe: Why DrawText() fails? Pin
David Crow3-Nov-11 4:22
David Crow3-Nov-11 4:22 
AnswerRe: Why DrawText() fails? Pin
Albert Holguin3-Nov-11 4:55
professionalAlbert Holguin3-Nov-11 4:55 
AnswerRe: Access violation: Something is NULL Pin
Software_Developer3-Nov-11 6:46
Software_Developer3-Nov-11 6:46 
QuestionRe: Access violation: Something is NULL Pin
bob169724-Nov-11 3:44
bob169724-Nov-11 3:44 
AnswerRe: Why DrawText() fails? Pin
Richard MacCutchan3-Nov-11 7:14
mveRichard MacCutchan3-Nov-11 7:14 
QuestionRestore folder to previous version? Pin
bosfan3-Nov-11 3:23
bosfan3-Nov-11 3:23 
AnswerRe: Restore folder to previous version? Pin
David Crow3-Nov-11 4:28
David Crow3-Nov-11 4:28 
GeneralRe: Restore folder to previous version? Pin
bosfan3-Nov-11 4:34
bosfan3-Nov-11 4:34 

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.