Click here to Skip to main content
15,896,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Weird VC++ behaviour Pin
DaFrawg4-Oct-03 2:23
DaFrawg4-Oct-03 2:23 
GeneralRe: Weird VC++ behaviour Pin
David Crow6-Oct-03 2:59
David Crow6-Oct-03 2:59 
GeneralRe: Weird VC++ behaviour Pin
Mike Dimmick3-Oct-03 23:52
Mike Dimmick3-Oct-03 23:52 
GeneralRe: Weird VC++ behaviour Pin
DaFrawg27-Oct-03 2:00
DaFrawg27-Oct-03 2:00 
QuestionSDK creation (export of variables)? Pin
sjcomp3-Oct-03 9:25
sjcomp3-Oct-03 9:25 
AnswerRe: SDK creation (export of variables)? Pin
Peter Weyzen3-Oct-03 9:34
Peter Weyzen3-Oct-03 9:34 
GeneralRe: SDK creation (export of variables)? Pin
sjcomp3-Oct-03 9:45
sjcomp3-Oct-03 9:45 
GeneralRe: SDK creation (export of variables)? Pin
Peter Weyzen3-Oct-03 9:55
Peter Weyzen3-Oct-03 9:55 
COM does use interfaces.

Each object basically has 2 class descriptors.


class __declspec(dllexport) CFredInterface
{
virtual void DoSomething() = 0;
};

class __declspec(dllexport) CFred : public CFredInterface
{
// variable definitions
// other method definitions

// and...
virtual void DoSomething() {}
};

CFredInterface __declspec(dllexport) *FredFactory()
{
return new CFred();
}

The interfaces let you publish only the parts of the classes that you want to other people. You only give out the headers to the interfaces, which defines how people interact with your objects, and doesn't make you share everything with the people that use your code.

The FredFactory gives you a way to instantiate a CFredInterface based class. The user only thinks they are getting a CFredInterface class, they don't need to what they are really getting (CFred).

You should read up on this stuff in "Design Patterns" -- a very important book for most OOP concepts. See: Amazon: http://www.amazon.com/exec/obidos/tg/detail/-/0201633612/002-6725511-1144041?v=glance[^]



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>

GeneralRe: SDK creation (export of variables)? Pin
sjcomp3-Oct-03 10:06
sjcomp3-Oct-03 10:06 
GeneralRe: SDK creation (export of variables)? Pin
Peter Weyzen3-Oct-03 10:27
Peter Weyzen3-Oct-03 10:27 
GeneralRe: SDK creation (export of variables)? Pin
sjcomp3-Oct-03 10:41
sjcomp3-Oct-03 10:41 
GeneralRe: SDK creation (export of variables)? Pin
Peter Weyzen3-Oct-03 11:24
Peter Weyzen3-Oct-03 11:24 
GeneralRe: SDK creation (export of variables)? Pin
sjcomp3-Oct-03 11:46
sjcomp3-Oct-03 11:46 
GeneralRe: SDK creation (export of variables)? Pin
Peter Weyzen3-Oct-03 12:10
Peter Weyzen3-Oct-03 12:10 
AnswerRe: SDK creation (export of variables)? Pin
Gopalakrishna Palem3-Oct-03 19:18
Gopalakrishna Palem3-Oct-03 19:18 
GeneralRe: SDK creation (export of variables)? Pin
sjcomp4-Oct-03 7:01
sjcomp4-Oct-03 7:01 
GeneralRe: SDK creation (export of variables)? Pin
Gopalakrishna Palem4-Oct-03 14:39
Gopalakrishna Palem4-Oct-03 14:39 
AnswerRe: SDK creation (export of variables)? Pin
sjcomp6-Oct-03 4:19
sjcomp6-Oct-03 4:19 
GeneralPSAPI and Winsock Pin
Peter Weyzen3-Oct-03 9:24
Peter Weyzen3-Oct-03 9:24 
GeneralCFormView Issues! Pin
Steven M Hunt3-Oct-03 8:59
Steven M Hunt3-Oct-03 8:59 
GeneralRe: CFormView Issues! Pin
Maximilien3-Oct-03 9:09
Maximilien3-Oct-03 9:09 
GeneralRe: CFormView Issues! Pin
vcplusplus3-Oct-03 9:23
vcplusplus3-Oct-03 9:23 
GeneralFile Open Pin
Anonymous3-Oct-03 8:24
Anonymous3-Oct-03 8:24 
GeneralRe: File Open Pin
Steven M Hunt3-Oct-03 8:54
Steven M Hunt3-Oct-03 8:54 
GeneralRe: File Open Pin
pma3-Oct-03 8:54
pma3-Oct-03 8:54 

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.