Board index » cppbuilder » ActiveX project upgrade BCB 3.0 to 4.0

ActiveX project upgrade BCB 3.0 to 4.0

Hi. We have developed some activex controls under bcb 3.0 and would like to
migrate them to v 4.0.

Having read readme.txt, bcb4new.hlp and using Turbopower's Project converter
( which works fine with our exe-projects ).

Still, following compile errors occur:

[C++ Error] atlcom.h(162): E2352 Cannot create instance of abstract class
'CComObject<TfrmInstrumentsImpl>'.

[C++ Error] atlcom.h(162): E2353 Class 'CComObject<TfrmInstrumentsImpl>' is
abstract because of '__stdcall IInstruments::get_Visible(TOLEBOOL *) = 0'.

atlcom.h:

template <class T1>
class CComCreator
{
public:
 static HRESULT WINAPI CreateInstance(void* pv, REFIID riid, LPVOID* ppv)
 {
  _ASSERTE(*ppv == NULL);
  HRESULT hRes = E_OUTOFMEMORY;
  T1* p = NULL;
->  ATLTRY(p = new T1(pv))  <-         ***** this is the error line
  if (p != NULL)

Any help greatly appreciated

Hokan Lindstroem
BlueSky Softworks AG

 

Re:ActiveX project upgrade BCB 3.0 to 4.0


Hokan,

I suspect the problem to be related to the switch from VARIANT_BOOL to
TOLEBOOL. Look in your implementation file for the 'get_Visible' method. I
suspect it still have the old signature. Change the VARIANT_BOOL parameter
to TOLEBOOL.

Let me know if the above does not help.

Regards,

Bruneau.

Quote
Hokan Lindstr?m wrote in message <7h9kqu$o...@forums.borland.com>...
>Hi. We have developed some activex controls under bcb 3.0 and would like to
>migrate them to v 4.0.

>Having read readme.txt, bcb4new.hlp and using Turbopower's Project
converter
>( which works fine with our exe-projects ).

>Still, following compile errors occur:

>[C++ Error] atlcom.h(162): E2352 Cannot create instance of abstract class
>'CComObject<TfrmInstrumentsImpl>'.

>[C++ Error] atlcom.h(162): E2353 Class 'CComObject<TfrmInstrumentsImpl>' is
>abstract because of '__stdcall IInstruments::get_Visible(TOLEBOOL *) = 0'.

>atlcom.h:

>template <class T1>
>class CComCreator
>{
>public:
> static HRESULT WINAPI CreateInstance(void* pv, REFIID riid, LPVOID* ppv)
> {
>  _ASSERTE(*ppv == NULL);
>  HRESULT hRes = E_OUTOFMEMORY;
>  T1* p = NULL;
>->  ATLTRY(p = new T1(pv))  <-         ***** this is the error line
>  if (p != NULL)

>Any help greatly appreciated

>Hokan Lindstroem
>BlueSky Softworks AG

Re:ActiveX project upgrade BCB 3.0 to 4.0


Tanks Bruneau, you are perfectly right. Had to change all types from
VARIANT_BOOL to TOLEBOOL. Strangely enough, it has so far only been the case
in one of many quite similar activex-projects ( the others seemed to be
converted automatically ).

Hokan Lindstroem
BlueSky Softworks AG

Quote
Jean-Marie Babet <brune...@msn.com> wrote in message

news:7hkcsc$56u7@forums.borland.com...
Quote
> Hokan,

> I suspect the problem to be related to the switch from VARIANT_BOOL to
> TOLEBOOL. Look in your implementation file for the 'get_Visible' method. I
> suspect it still have the old signature. Change the VARIANT_BOOL parameter
> to TOLEBOOL.

> Let me know if the above does not help.

> Regards,

> Bruneau.

> Hokan Lindstr?m wrote in message <7h9kqu$o...@forums.borland.com>...
> >Hi. We have developed some activex controls under bcb 3.0 and would like
to
> >migrate them to v 4.0.

> >Having read readme.txt, bcb4new.hlp and using Turbopower's Project
> converter
> >( which works fine with our exe-projects ).

> >Still, following compile errors occur:

> >[C++ Error] atlcom.h(162): E2352 Cannot create instance of abstract class
> >'CComObject<TfrmInstrumentsImpl>'.

> >[C++ Error] atlcom.h(162): E2353 Class 'CComObject<TfrmInstrumentsImpl>'
is
> >abstract because of '__stdcall IInstruments::get_Visible(TOLEBOOL *) =
0'.

> >atlcom.h:

> >template <class T1>
> >class CComCreator
> >{
> >public:
> > static HRESULT WINAPI CreateInstance(void* pv, REFIID riid, LPVOID* ppv)
> > {
> >  _ASSERTE(*ppv == NULL);
> >  HRESULT hRes = E_OUTOFMEMORY;
> >  T1* p = NULL;
> >->  ATLTRY(p = new T1(pv))  <-         ***** this is the error line
> >  if (p != NULL)

> >Any help greatly appreciated

> >Hokan Lindstroem
> >BlueSky Softworks AG

Re:ActiveX project upgrade BCB 3.0 to 4.0


Hokan,

You're not the first person mentioning the need to manually perform this
task. I don't work very closely with the code manager but this should have
been handled automatically. [I have a trip schedule to the PortingLab of a
big company North:) soon. I was thinking that maybe we should do Porting
Labs too: we do have some people bring their code and spend a few days with
beta copies of the product. Unfortunately, these don't always bring out
issues like this failure of the code manager to consistently update
VARIANT_BOOL to TOLEBOOL].

Please, do let us know if you hit any other glitches during the port.

Regards,

Bruneau.

Quote
Hokan Lindstr?m wrote in message <7httgh$d...@forums.borland.com>...
>Tanks Bruneau, you are perfectly right. Had to change all types from
>VARIANT_BOOL to TOLEBOOL. Strangely enough, it has so far only been the
case
>in one of many quite similar activex-projects ( the others seemed to be
>converted automatically ).

>Hokan Lindstroem
>BlueSky Softworks AG

>Jean-Marie Babet <brune...@msn.com> wrote in message
>news:7hkcsc$56u7@forums.borland.com...
>> Hokan,

>> I suspect the problem to be related to the switch from VARIANT_BOOL to
>> TOLEBOOL. Look in your implementation file for the 'get_Visible' method.
I
>> suspect it still have the old signature. Change the VARIANT_BOOL
parameter
>> to TOLEBOOL.

>> Let me know if the above does not help.

>> Regards,

>> Bruneau.

>> Hokan Lindstr?m wrote in message <7h9kqu$o...@forums.borland.com>...
>> >Hi. We have developed some activex controls under bcb 3.0 and would like
>to
>> >migrate them to v 4.0.

>> >Having read readme.txt, bcb4new.hlp and using Turbopower's Project
>> converter
>> >( which works fine with our exe-projects ).

>> >Still, following compile errors occur:

>> >[C++ Error] atlcom.h(162): E2352 Cannot create instance of abstract
class
>> >'CComObject<TfrmInstrumentsImpl>'.

>> >[C++ Error] atlcom.h(162): E2353 Class 'CComObject<TfrmInstrumentsImpl>'
>is
>> >abstract because of '__stdcall IInstruments::get_Visible(TOLEBOOL *) =
>0'.

>> >atlcom.h:

>> >template <class T1>
>> >class CComCreator
>> >{
>> >public:
>> > static HRESULT WINAPI CreateInstance(void* pv, REFIID riid, LPVOID*
ppv)
>> > {
>> >  _ASSERTE(*ppv == NULL);
>> >  HRESULT hRes = E_OUTOFMEMORY;
>> >  T1* p = NULL;
>> >->  ATLTRY(p = new T1(pv))  <-         ***** this is the error line
>> >  if (p != NULL)

>> >Any help greatly appreciated

>> >Hokan Lindstroem
>> >BlueSky Softworks AG

Other Threads