Board index » cppbuilder » Importing ActiveX / Type library

Importing ActiveX / Type library


2006-05-25 03:15:43 PM
cppbuilder100
Hello NG,
I'm trying to import and ActiveX / Type Library without success ... the
automated procedure fail to define InitControlData() method and related data
structures.... I tried to build them up by myself but I had no luck (maybe
I'm missing something).
Can anyone help me... there's a tutorial somewhere ?
Best regards,
--
bye by(t)e[s]....TuX!
 
 

Re:Importing ActiveX / Type library

Hi,
Quote

I'm trying to import and ActiveX / Type Library without success ... the
automated procedure fail to define InitControlData() method and related data
structures.... I tried to build them up by myself but I had no luck (maybe
I'm missing something).

You should not have to manually create any of that.
Just now, I have downloaded the free evaluation of Iconics
Gauge and it imported, compiled, and installed just fine,
no errors.
It even displays nicely on a form after installing, no license
errors, etc.
Quote
Can anyone help me... there's a tutorial somewhere ?
I'm sort of stumped as to why it fails for you so I
suggest you try again. In brief this is what I did:
1) Make sure there there are no exsting GWX*.* files
in the default projects directory
2) File | New | Other... | C++ Projects | Package
3) File | Save Project As...
[saved GaugeImpPack.bpk into default projects directory]
4) Component | Import Component | Import ActiveX Control,
and click Next
5) Find the help string, "ICONICS GWXGauge ActiveX"
in the list, select it and click Next
6) Change "Unit Dir Name" to default projects directoy,
leave defaults like "Generate Component Wrappers" ON,
click Next.
7) Set the radio button ON to "Add unt to GaugeImpPack",
and click Finish
After this the package project should contain both
GWGAUGELIB_OCX.cpp and GWGAUGELIB_TLB.cpp along with
the matching .dcr.
Right-click on GaugeImpPack.bp and select "Install" should
then compile and install.
If that fails then:
1) Have all updates been applied?
2) Check Tools | Options | Environment Options |
C++ Options | Type Library for any non-default settings
[the defaults here basically are "all of them OFF"]. I
can't think of a setting here that would cause no
InitControlData to be generated but it is worth checking.
3) Try some other ActiveX imports. Do they all fail?
--Craig
 

Re:Importing ActiveX / Type library

I'll try again but I don't think I will have more luck since I think I did
the same things the last time.
BTW I tried to import the Adobe Acrobat ActiveX and I had the same result...
--
bye by(t)e[s]....TuX!
"Craig Farrell" < XXXX@XXXXX.COM >ha scritto nel
messaggio news:44761c4c$ XXXX@XXXXX.COM ...
Quote
Hi,

>
>I'm trying to import and ActiveX / Type Library without success ... the
>automated procedure fail to define InitControlData() method and related
>data structures.... I tried to build them up by myself but I had no luck
>(maybe I'm missing something).
>

You should not have to manually create any of that.
Just now, I have downloaded the free evaluation of Iconics
Gauge and it imported, compiled, and installed just fine,
no errors.
It even displays nicely on a form after installing, no license
errors, etc.

>Can anyone help me... there's a tutorial somewhere ?

I'm sort of stumped as to why it fails for you so I
suggest you try again. In brief this is what I did:

1) Make sure there there are no exsting GWX*.* files
in the default projects directory
2) File | New | Other... | C++ Projects | Package
3) File | Save Project As...
[saved GaugeImpPack.bpk into default projects directory]
4) Component | Import Component | Import ActiveX Control,
and click Next
5) Find the help string, "ICONICS GWXGauge ActiveX"
in the list, select it and click Next
6) Change "Unit Dir Name" to default projects directoy,
leave defaults like "Generate Component Wrappers" ON,
click Next.
7) Set the radio button ON to "Add unt to GaugeImpPack",
and click Finish
After this the package project should contain both
GWGAUGELIB_OCX.cpp and GWGAUGELIB_TLB.cpp along with
the matching .dcr.
Right-click on GaugeImpPack.bp and select "Install" should
then compile and install.
If that fails then:
1) Have all updates been applied?
2) Check Tools | Options | Environment Options |
C++ Options | Type Library for any non-default settings
[the defaults here basically are "all of them OFF"]. I
can't think of a setting here that would cause no
InitControlData to be generated but it is worth checking.
3) Try some other ActiveX imports. Do they all fail?

--Craig



 

{smallsort}

Re:Importing ActiveX / Type library

Hi,
Quote
BTW I tried to import the Adobe Acrobat ActiveX and I had the same result...
Very odd. This is BDS2006? What edition,
Pro, Ent, Arch?
Anyway, can you try a command line import?
Paste the following into a .bat file and run it:
tlibimp -C+ -Ha+ -HpaActiveX "C:\Program
Files\ICONICS\GENESIS-32\Bin\GWXGauge.ocx"
[adjust the path to the ocx if necessary, of course]
Then add GWXGAUGELib_OCX.cpp and GWXGAUGELib_TLB.cpp
to a package and install the package.
If this still fails I can only think of very odd
problems like someone over-wrote your ..\bin\tlibimp.sym
or one of the Updates only partially installed or
something odd like that. You're not generating
a C++ header, .hpp from a _TLB.pas import are you?
--Craig
 

Re:Importing ActiveX / Type library

Quote
Very odd. This is BDS2006? What edition, Pro, Ent, Arch?
He's not the only one with problems. I've tried to import the Macromedia Flash Player (Flash.OCX version 7.0.19.0) that we have used quite happily
in BCB5, and it comes up with several errors (sorry about the very long lines). This on a fresh install of BDS Pro (C++ and Delphi personalities
only, and leaving out several bits we don't want!); if it makes any difference the machine already has BCB5, BCB6, and MSVC installed. If anyone
wants to try it, and hasn't got the OCX, let me know and I'll send it to them.
Mike
[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::GetDispID(wchar_t *, unsigned long, long *)' referenced
from C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::RemoteInvokeEx(long, unsigned long, unsigned long,
tagDISPPARAMS *, tagVARIANT *, tagEXCEPINFO *, Shockwaveflashobjects_tlb::IServiceProvider *, unsigned int, unsigned int *, tagVARIANT *)'
referenced from C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::DeleteMemberByName(wchar_t *, unsigned long)'
referenced from C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::DeleteMemberByDispID(long)' referenced from
C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::GetMemberProperties(long, unsigned long, unsigned long
*)' referenced from C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::GetMemberName(long, wchar_t * *)' referenced from
C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::GetNextDispID(unsigned long, long, long *)' referenced
from C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::GetNameSpaceParent(IUnknown * *)' referenced from
C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
 

Re:Importing ActiveX / Type library

Nope BCB 6 Pro SP2....
I tried to import the ActiveX with the command line procedure and I got the
same result..
Below you can find the GWXGAUGELib_OCX.cpp source code:
// GWXGAUGELib_OCX.cpp
// ************************************************************************
//
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************
//
// C++ TLBWRTR : $Revision: 1.151.1.0.1.21 $
// File generated on 31/05/2006 15.23.25 from Type Library described below.
// ************************************************************************
//
// Type Lib: C:\Programmi\ICONICS\GENESIS-32\Bin\GWXGauge.ocx (1)
// LIBID: {1AB2B1E6-4B24-11D1-9D72-00A024C1118E}
// LCID: 0
// Helpfile: C:\Programmi\ICONICS\GENESIS-32\Bin\GWXGauge.hlp
// HelpString: ICONICS GWXGauge ActiveX
// DepndLst:
// (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
// ************************************************************************
//
#include <vcl.h>
#pragma hdrstop
#include <olectrls.hpp>
#include <oleserver.hpp>
#if defined(USING_ATL)
#include <atl\atlvcl.h>
#endif
#include "GWXGAUGELib_OCX.h"
#if !defined(__PRAGMA_PACKAGE_SMART_INIT)
#define __PRAGMA_PACKAGE_SMART_INIT
#pragma package(smart_init)
#endif
"Craig Farrell" < XXXX@XXXXX.COM >ha scritto nel
messaggio news:447cfb2a$ XXXX@XXXXX.COM ...
Quote
Hi,

>BTW I tried to import the Adobe Acrobat ActiveX and I had the same
>result...

Very odd. This is BDS2006? What edition,
Pro, Ent, Arch?
Anyway, can you try a command line import?
Paste the following into a .bat file and run it:

tlibimp -C+ -Ha+ -HpaActiveX "C:\Program
Files\ICONICS\GENESIS-32\Bin\GWXGauge.ocx"

[adjust the path to the ocx if necessary, of course]
Then add GWXGAUGELib_OCX.cpp and GWXGAUGELib_TLB.cpp
to a package and install the package.

If this still fails I can only think of very odd
problems like someone over-wrote your ..\bin\tlibimp.sym
or one of the Updates only partially installed or
something odd like that. You're not generating
a C++ header, .hpp from a _TLB.pas import are you?


--Craig

 

Re:Importing ActiveX / Type library

Hi,
Quote
BCB 6 Pro SP2...
You should also apply Update4 IMO.
Quote
// C++ TLBWRTR : $Revision: 1.151.1.0.1.21 $

I think that you have a downloaded public beta of
tlib60.bpl being found first on your system.
You should see a revison there like 1.151.1.0.1.27.
If the one in ..\bin looks OK, check everywhere
including the Windows System directory for one
that could be found first on the path. Note some
patch systems like the one used for BCB6 will not
apply a new file over one that is "user modified"
i.e. different than the time and date, and version
of the one it expects. So any file for which there
were public beta's like tlib60.bpl and utilcls.h
should be checked to verify they get updated.
--Craig
 

Re:Importing ActiveX / Type library

Hi,
Quote

He's not the only one with problems. I've tried to import the Macromedia Flash Player (Flash.OCX version 7.0.19.0) that we have used quite happily

[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::GetDispID(wchar_t *, unsigned long, long *)' referenced
from C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
In the file, ShockwaveFlashObjects_OCX.cpp add the
"inline" keyword for all of the unresolved externals,
e.g.
void inline __fastcall TFlashObjectInterface::GetDispID(BSTR
bstrName/*[in]*/, unsigned_long grfdex/*[in]*/,
long* pid/*[out]*/)
{
GetDefaultInterface()->GetDispID(bstrName/*[in]*/,
grfdex/*[in]*/, pid/*[out]*/);
}
--Craig
 

Re:Importing ActiveX / Type library

Quote
You should also apply Update4 IMO.
I did it already
Quote
>// C++ TLBWRTR : $Revision: 1.151.1.0.1.21 $
>

I think that you have a downloaded public beta of
tlib60.bpl being found first on your system.
You should see a revison there like 1.151.1.0.1.27.
If the one in ..\bin looks OK, check everywhere
including the Windows System directory for one
that could be found first on the path. Note some
patch systems like the one used for BCB6 will not
apply a new file over one that is "user modified"
i.e. different than the time and date, and version
of the one it expects. So any file for which there
were public beta's like tlib60.bpl and utilcls.h
should be checked to verify they get updated.
I had just one tlib60.bpl plus one backup of the same file tlib60.bpl.old in
the \bin directory.
In both file the revision is 6.0.10.166
No more file of this kind where found.
 

Re:Importing ActiveX / Type library

Thanks Craig
Well, it works (at least, the OCX now installs; I haven't yet rebuilt the app that uses it)! But I don't understand why: I
thought I understood "inline" but here it is clearly forcing something a bit strange to happen.
Is this already in QC, or does it need adding?
Mike
Quote
>
>He's not the only one with problems. I've tried to import the Macromedia Flash Player (Flash.OCX version 7.0.19.0) that we
have used quite happily

>
>[Linker Error] Error: Unresolved external '__stdcall Shockwaveflashobjects_tlb::IDispatchEx::GetDispID(wchar_t *, unsigned
long, long *)' referenced
>from C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO
PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ

In the file, ShockwaveFlashObjects_OCX.cpp add the
"inline" keyword for all of the unresolved externals,
e.g.
void inline __fastcall TFlashObjectInterface::GetDispID(BSTR
bstrName/*[in]*/, unsigned_long grfdex/*[in]*/,
long* pid/*[out]*/)
{
GetDefaultInterface()->GetDispID(bstrName/*[in]*/,
grfdex/*[in]*/, pid/*[out]*/);
}
 

Re:Importing ActiveX / Type library

Mike, my QC#23482 addresses this issue.
Thanks for this workaround Craig. I see you've also updated the QC report,
thanks.
Richard.
"Mike Goodey" < XXXX@XXXXX.COM >wrote in message
Quote
Thanks Craig

Well, it works (at least, the OCX now installs; I haven't yet rebuilt the
app that uses it)! But I don't understand why: I
thought I understood "inline" but here it is clearly forcing something a
bit strange to happen.

Is this already in QC, or does it need adding?

Mike

>>
>>He's not the only one with problems. I've tried to import the
>>Macromedia Flash Player (Flash.OCX version 7.0.19.0) that we
>have used quite happily
>
>>
>>[Linker Error] Error: Unresolved external '__stdcall
>>Shockwaveflashobjects_tlb::IDispatchEx::GetDispID(wchar_t *, unsigned
>long, long *)' referenced
>>from C:\DOCUMENTS AND SETTINGS\MJG.IB\MY DOCUMENTS\BORLAND STUDIO
>PROJECTS\DEBUG_BUILD\SHOCKWAVEFLASHOBJECTS_OCX.OBJ
>
>In the file, ShockwaveFlashObjects_OCX.cpp add the
>"inline" keyword for all of the unresolved externals,
>e.g.
>void inline __fastcall TFlashObjectInterface::GetDispID(BSTR
>bstrName/*[in]*/, unsigned_long grfdex/*[in]*/,
>long* pid/*[out]*/)
>{
>GetDefaultInterface()->GetDispID(bstrName/*[in]*/,
>grfdex/*[in]*/, pid/*[out]*/);
>}



 

Re:Importing ActiveX / Type library

In article <447ec65d$ XXXX@XXXXX.COM >, Richard Rickwood wrote:
Quote
Mike, my QC#23482 addresses this issue.

Thanks for this workaround Craig. I see you've also updated the QC report,
thanks.
Thanks Richard
Mike
 

Re:Importing ActiveX / Type library

Hi,
Quote
>>// C++ TLBWRTR : $Revision: 1.151.1.0.1.21 $
>You should see a revison there like 1.151.1.0.1.27.
Sorry, I was being unclear there. That is the revision number
of the internal "TLBWRTR" and will not map to a .bpl./dll revision
or version. If the revision comment in all your imports has
the 1.21 instead of 1.27, then you are getting the beta
somehow.
Quote
I had just one tlib60.bpl plus one backup of the same file tlib60.bpl.old in
the \bin directory.

If you have Update4 applied, the file should be:
1/30/03 6:04 479,232 tlib60.bpl
--Craig
 

Re:Importing ActiveX / Type library

Hi,
Quote
"inline" but here it is clearly forcing something a bit strange to happen.
I think, in this case, "inline" avoids a compiler bug that
is making those references seem external for some reason.
Not sure the pattern: implementing interface methods
out-of-line in a class with a PACKAGE modifier seems
to be the common ground but other implementated methods
seem to work.
--Craig