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

C / C++ / MFC

 
GeneralMFC and ATL wizard order Pin
Debs2-Oct-02 23:03
Debs2-Oct-02 23:03 
GeneralRe: MFC and ATL wizard order Pin
Stephane Rodriguez.2-Oct-02 23:25
Stephane Rodriguez.2-Oct-02 23:25 
GeneralRe: MFC and ATL wizard order Pin
Debs2-Oct-02 23:55
Debs2-Oct-02 23:55 
GeneralRe: MFC and ATL wizard order Pin
Stephane Rodriguez.3-Oct-02 0:10
Stephane Rodriguez.3-Oct-02 0:10 
GeneralRanges in Excel Pin
Anonymous2-Oct-02 22:26
Anonymous2-Oct-02 22:26 
GeneralRe: Ranges in Excel Pin
Stephane Rodriguez.2-Oct-02 23:08
Stephane Rodriguez.2-Oct-02 23:08 
GeneralRe: Ranges in Excel Pin
Anonymous3-Oct-02 7:10
Anonymous3-Oct-02 7:10 
GeneralIMPLEMENT_SERIAL problem Pin
Stefan Larsson2-Oct-02 22:22
Stefan Larsson2-Oct-02 22:22 
I have a problem with the macro IMPLEMENT_SERIAL in VC7.

What I have is a BaseDLL containing BaseClass which at compile time is exported from the dll.

class __declspec(dllexport) BaseClass : public CObject
{
DECLARE_SERIAL(BaseClass)

...

}

I also have got a DerivedDLL containing DerivedClass and AnotherClass. At compile time it would look like this

#include <basedll baseclass.h="">

class __declspec(dllexport) DerivedClass : public BaseClass
{
DECLARE_SERIAL(DerivedClass)

...

}

class __declspec(dllexport) AnotherClass : public BaseClass
{
DECLARE_SERIAL(AnotherClass)

...

}

When compiling DerivedDLL, BaseClass has the following look

class __declspec(dllimport) BaseClass : public CObject
{
DECLARE_SERIAL(BaseClass)

...

}

In the implementation file of DerivedClass and AnotherClass I have

IMPLEMENT_SERIAL(DerivedClass, BaseClass, 1)
IMPLEMENT_SERIAL(AnotherClass, BaseClass, 1)

This IMPLEMENT_SERIAL macro doesn't seem to work correctly (although it seems to work in VC6). When adding the classes to the DerivedDLL's list of run-time classes one of the classes is cut off and later on the program can't find the run-time class of AnotherClass.

I've found out that if I exchange BaseClass to CObject it works, but I don't know if it works correctly.
If I move BaseClass from BaseDLL to DerivedDLL it works, but I don't want BaseClass in DerivedDLL.
If I make sure that when compiling DerivedDLL that BaseClass is declared dllexport it works, but it might give me problems later since DerivedDLL doesn't have the implementation code of BaseClass.

Does anyone know why it doesn't work in VC7?
Does anyone have a safe work-around to the problem?
Is there a bug in the VC7 compiler?
GeneralRe: IMPLEMENT_SERIAL problem Pin
benjymous2-Oct-02 23:23
benjymous2-Oct-02 23:23 
GeneralRe: IMPLEMENT_SERIAL problem Pin
Stefan Larsson2-Oct-02 23:51
Stefan Larsson2-Oct-02 23:51 
GeneralRe: IMPLEMENT_SERIAL problem Pin
Tomasz Sowinski3-Oct-02 3:55
Tomasz Sowinski3-Oct-02 3:55 
GeneralRe: IMPLEMENT_SERIAL problem Pin
Stefan Larsson3-Oct-02 4:05
Stefan Larsson3-Oct-02 4:05 
GeneralCTreeCtrl question Pin
joblemar2-Oct-02 21:55
sussjoblemar2-Oct-02 21:55 
GeneralRe: CTreeCtrl question Pin
Nish Nishant2-Oct-02 22:26
sitebuilderNish Nishant2-Oct-02 22:26 
GeneralCHTMLVIEW Pin
candan2-Oct-02 21:53
professionalcandan2-Oct-02 21:53 
GeneralRe: CHTMLVIEW Pin
Stephane Rodriguez.2-Oct-02 22:02
Stephane Rodriguez.2-Oct-02 22:02 
Generalretrieving process version Pin
Black ghost2-Oct-02 21:41
Black ghost2-Oct-02 21:41 
GeneralRe: retrieving process version Pin
Stephane Rodriguez.2-Oct-02 22:11
Stephane Rodriguez.2-Oct-02 22:11 
GeneralMS Shell Dlg Font Pin
Daaave2-Oct-02 19:02
Daaave2-Oct-02 19:02 
GeneralRe: MS Shell Dlg Font Pin
Michael Dunn2-Oct-02 19:20
sitebuilderMichael Dunn2-Oct-02 19:20 
GeneralRe: MS Shell Dlg Font Pin
Daaave2-Oct-02 19:40
Daaave2-Oct-02 19:40 
GeneralGetting absolute URL from relative Pin
Alex Cramer2-Oct-02 18:32
Alex Cramer2-Oct-02 18:32 
GeneralRe: Getting absolute URL from relative Pin
Stephane Rodriguez.2-Oct-02 22:13
Stephane Rodriguez.2-Oct-02 22:13 
QuestionWhats the equivalent of CString.m_pchData in VS.NET? Pin
Alvaro Mendez2-Oct-02 17:54
Alvaro Mendez2-Oct-02 17:54 
AnswerRe: Whats the equivalent of CString.m_pchData in VS.NET? Pin
Alex Cramer2-Oct-02 18:59
Alex Cramer2-Oct-02 18:59 

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.