Board index » cppbuilder » Run Time instantiating an Active X control

Run Time instantiating an Active X control

Dear Sir,

I am developing a multithreaded application that has to instantiate each
thread an active X control.

I am using this approach:

__fastcall GateWayThread::GateWayThread(bool CreateSuspended)
        : TThread(CreateSuspended)
{
        //TFsievent new aux;
        Fsievent1 = new TFsievent(0); // Active X control

Quote
}

when compiling I am getting the following error:

[C++ Error] UnitThread.cpp(28): E2015 Ambiguity between '_fastcall
Fsieventlib_tlb::TFsievent::TFsievent(Classes::TComponent *)' and '_fastcall
Fsieventlib_tlb::TFsievent::TFsievent(void *)'.

Is this the proper way to instantiate an imported Active X control?.

Any help is appretiate!!!!

Luis Franco.

 

Re:Run Time instantiating an Active X control


Quote
In article <3b7834f1_1@dnews>, Luis Franco <francol...@cantv.net> wrote:
>__fastcall GateWayThread::GateWayThread(bool CreateSuspended)
>        : TThread(CreateSuspended)
>{
>        //TFsievent new aux;
>        Fsievent1 = new TFsievent(0); // Active X control
>}

>when compiling I am getting the following error:

>[C++ Error] UnitThread.cpp(28): E2015 Ambiguity between '_fastcall
>Fsieventlib_tlb::TFsievent::TFsievent(Classes::TComponent *)' and '_fastcall
>Fsieventlib_tlb::TFsievent::TFsievent(void *)'.

Oops. The problem here is that the control expects its constructor
to be passed a pointer to a TComponent. In Delphi, you can pass it
nil, and all will work, but the type safety in the BCB compiler complains.

You need to do:

FSievent1 = new TFSievent(<reinterpret_cast>(TComponent*)0);

Other Threads