Click here to Skip to main content
15,918,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: bloat reduction Pin
Waldermort27-Sep-06 2:44
Waldermort27-Sep-06 2:44 
AnswerRe: bloat reduction Pin
Mike Dimmick27-Sep-06 4:04
Mike Dimmick27-Sep-06 4:04 
GeneralRe: bloat reduction Pin
Waldermort27-Sep-06 4:50
Waldermort27-Sep-06 4:50 
QuestionClose an instance Pin
ayol1212227-Sep-06 1:34
ayol1212227-Sep-06 1:34 
AnswerRe: Close an instance Pin
Stephen Hewitt27-Sep-06 1:56
Stephen Hewitt27-Sep-06 1:56 
AnswerRe: Close an instance Pin
prasad_som27-Sep-06 1:58
prasad_som27-Sep-06 1:58 
GeneralRe: Close an instance Pin
ayol1212227-Sep-06 3:31
ayol1212227-Sep-06 3:31 
Questionerror LNK2001 Pin
Rems Kris27-Sep-06 1:24
Rems Kris27-Sep-06 1:24 
Hi,

I've created an ActiveX control. The Control class (***Ctl) in it should be derived from a class in another dll (which is also created by me). I want to load the ActiveX control dynamically in a container exe and check if the Ctl class is derived from the base class in the dll (This container is also created by me).

The base class in the dll is called TusMacroOcxBase and it is derived from COleControl.
The Ctl class in the ActiveX control which is derived from TusMacroOcxBase is called CTusSampleOcxCtrl.

I decided to make use of CRuntime class's methods to check the class type information (Since COleControl is already derived from CObject). So I proceeded by using the DECLARE_DYNAMIC/DECLARE_DYNCREATE and IMPLEMENT_DYNAMIC/IMPLEMENT_DYNCREATE macros. I also enabled RTTI in the container exe.

My problem is that when I write IMPLEMENT_DYNCREATE(CTusSampleOcxCtrl, TusMacroOcxBase) in CTusSampleOcxCtrl class's .cpp file, it gives error LNK2001.
The error message is given below.
TusSampleOcxCtl.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const TusMacroOcxBase::classTusMacroOcxBase" (?classTusMacroOcxBase@TusMacroOcxBase@@2UCRuntimeClass@@B)

Here is the code snippet:

Base class - .h

class _declspec(dllexport) TusMacroOcxBase : public COleControl
{


public:

DECLARE_DYNAMIC(TusMacroOcxBase)
....

Base class - .cpp

IMPLEMENT_DYNAMIC( TusMacroOcxBase, COleControl )

Derived class - .h

class CTusSampleOcxCtrl : public TusMacroOcxBase
{
DECLARE_DYNCREATE(CTusSampleOcxCtrl)
....

Derived class - .cpp

IMPLEMENT_DYNCREATE(CTusSampleOcxCtrl, TusMacroOcxBase)

I can solve the error easily by replacing IMPLEMENT_DYNCREATE(CTusSampleOcxCtrl, TusMacroOcxBase) with IMPLEMENT_DYNCREATE(CTusSampleOcxCtrl, COleControl), but I cant do that since I need to get the exact base class of CTusSampleOcxCtrl in the container exe. If I give COleControl there, I will get the base class as COleControl only.
Is there any other way? I've tried different combinations of DECLARE_DYNAMIC/DECLARE_DYNCREATE and IMPLEMENT_DYNAMIC/IMPLEMENT_DYNCREATE also.

Any help will be greatly appreciated.


Thanks in advance,
Rems.
AnswerRe: error LNK2001 Pin
Rinu_Raj27-Sep-06 1:39
Rinu_Raj27-Sep-06 1:39 
GeneralRe: error LNK2001 Pin
Rems Kris27-Sep-06 1:48
Rems Kris27-Sep-06 1:48 
GeneralRe: error LNK2001 Pin
Rinu_Raj27-Sep-06 2:04
Rinu_Raj27-Sep-06 2:04 
GeneralRe: error LNK2001 Pin
Rems Kris27-Sep-06 17:43
Rems Kris27-Sep-06 17:43 
QuestionExtract all text strings from a HTML file. How ? Pin
Sakthiu27-Sep-06 0:13
Sakthiu27-Sep-06 0:13 
AnswerRe: Extract all text strings from a HTML file. How ? Pin
Hamid_RT27-Sep-06 0:21
Hamid_RT27-Sep-06 0:21 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Sakthiu27-Sep-06 0:54
Sakthiu27-Sep-06 0:54 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Waldermort27-Sep-06 1:01
Waldermort27-Sep-06 1:01 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Sakthiu27-Sep-06 1:04
Sakthiu27-Sep-06 1:04 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Rajesh R Subramanian27-Sep-06 1:08
professionalRajesh R Subramanian27-Sep-06 1:08 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Sakthiu27-Sep-06 1:23
Sakthiu27-Sep-06 1:23 
AnswerRe: Extract all text strings from a HTML file. How ? Pin
Rajesh R Subramanian27-Sep-06 1:28
professionalRajesh R Subramanian27-Sep-06 1:28 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Sakthiu27-Sep-06 1:35
Sakthiu27-Sep-06 1:35 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Rajesh R Subramanian27-Sep-06 1:38
professionalRajesh R Subramanian27-Sep-06 1:38 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Waldermort27-Sep-06 1:55
Waldermort27-Sep-06 1:55 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Waldermort27-Sep-06 1:57
Waldermort27-Sep-06 1:57 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
David Crow27-Sep-06 2:42
David Crow27-Sep-06 2:42 

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.