 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Sun Mar 13, 2005 11:14 pm Post subject: Importing ActiveX to BCB6 |
|
|
Hello,
BCB6 cannot import ActiveX controls correct. The same controls can be
imported successfully in BCB5. I recall that this was a problem already when
BCB6 was introduced. That kept me from using BCB6. I now need to. I have
applied all the updates. The latest seem to be update4. The import problem
is still not fixed! Why? It must be a problem for many using BCB6. What does
Borland say? Does anyone know of a workaround?
I need a good grid control with BCB6. I have tried to import SftTree/OCX
from www.softelvdm.com and iGrid from www.10tec.com but both fail to import
correct.
Does anyone know of a good grid control that do work with BCB6?
/Ivar
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sun Mar 13, 2005 11:45 pm Post subject: Re: Importing ActiveX to BCB6 |
|
|
<iware (AT) iware (DOT) se> wrote
| Quote: | BCB6 cannot import ActiveX controls correct.
|
Just saying it does not work says nothing at all about the actual problem
you are having. You need to be more specific.
Gambit
|
|
| Back to top |
|
 |
Harald Plontke Guest
|
Posted: Tue Mar 15, 2005 9:13 pm Post subject: Re: Importing ActiveX to BCB6 |
|
|
Hello,
| Quote: | Just saying it does not work says nothing at all about the actual problem
you are having. You need to be more specific.
|
I reported a similar problem some weeks ago under the subject "ocx-functions
never get called" but never get any answer. I added a detailed description
and some code with my question. I also asked Borland in Germany and they
told me, that something with ocx-handling has changed with BCB6 and this is
documented somewhere. They promised me to send me a more detailed answer.
If I get some information from Borland, I will post it here.
Harald
|
|
| Back to top |
|
 |
Guest
|
Posted: Wed Mar 16, 2005 10:02 am Post subject: Re: Importing ActiveX to BCB6 |
|
|
Hi,
The problem with the original importer, after UPDATE4, is that the generated
header is not correct. The first I noticed was that all write information in
the properties were missing. I have contacted Borland and received this
answer:
"There are a few beta type library importers available from the Borland
website:
http://search.borland.com/query.html?qt=type+library+importer&qs=&qc=&pw=100%25&ws=0&la=&qm=0&st=1&nh=10&lk=1&rf=0&oq=&rq=0&col=bogus&col=nowebdsp
The latest one, and the one that I recommend trying, is this one:
http://bdn.borland.com/article/0,1410,29110,00.html
Be sure to read the installation instructions before using the new type
library importer. It should take care of some of the issues that existed
with the original importer. However, also bear in mind that ActiveX controls
are sometimes product version-specific, and not all controls are necessarily
compatible with all product versions. If these are third party ActiveX
controls, I recommend checking with the vendor to verify that they will work
with C++Builder 6."
So far I have only tried the one he recommends. The generated header is
quite different. The write information is there but there are other problems
that prevents it from being compiled. I will do some more research and get
back.
Anyway, Borland regocnizes the problem. Why should the otherwise publish
more importers? I doubt though that they will work on it more. I gues that
we have to wait for next version of C++ Builder.
How can they have a working importer in BCB5 and not in BCB6?
/Ivar
|
|
| Back to top |
|
 |
Harald Plontke Guest
|
Posted: Wed Mar 16, 2005 9:07 pm Post subject: Re: Importing ActiveX to BCB6 |
|
|
Hello,
I tried it, but it imports nothing from the ocx. Sorry about the long
sourcecode, I hope you can read through it:
The EVENT_PROTOKOLLLib_OCX.h imported with the new beta version looks like:
---
// ************************************************************************
//
// WARNUNG
// -------
// Die in dieser Datei deklarierten Typen wurden aus Daten einer
Typbibliothek
// generiert. Wenn diese Typbibliothek explizit oder indirekt (über eine
// andere Typbibliothek) reimportiert wird oder wenn die Anweisung
// 'Aktualisieren' im Typbibliotheks-Editor während des Bearbeitens der
// Typbibliothek aktiviert ist, wird der Inhalt dieser Datei neu generiert
und
// alle manuell vorgenommenen Änderungen gehen verloren.
// ************************************************************************
//
// C++ TLBWRTR : $Revision: 1.151.1.0.1.21 $
// Datei generiert am 16.03.2005 21:49:39 aus der unten beschriebenen
Typbibliothek.
// ************************************************************************
//
// Typbib: E:DatenProjekteIDCDiverse DateienEffeff
EventprotokollEvent_Protokoll.ocx (1)
// LIBID: {B2DD83C5-9D33-11D1-8ECA-500012356402}
// LCID: 0
// Hilfedatei: E:DatenProjekteIDCDiverse DateienEffeff
EventprotokollEvent_Protokoll.hlp
// Hilfe-String: Event_Protokoll ActiveX Control module
// DepndLst:
// (1) v2.0 stdole, (C:WINNTSystem32STDOLE2.TLB)
// ************************************************************************
//
#include <vcl.h>
#pragma hdrstop
#include <olectrls.hpp>
#include <oleserver.hpp>
#if defined(USING_ATL)
#include <atlatlvcl.h>
#endif
#include "EVENT_PROTOKOLLLib_OCX.h"
#if !defined(__PRAGMA_PACKAGE_SMART_INIT)
#define __PRAGMA_PACKAGE_SMART_INIT
#pragma package(smart_init)
#endif
namespace Event_protokolllib_tlb
{
}; // namespace Event_protokolllib_tlb
---
but in BCB5 it looks:
---
// ************************************************************************
//
// 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.134.1.39 $
// File generated on 09.11.2003 18:47:00 from Type Library described below.
// ************************************************************************
//
// Type Lib: C:ProgrammeGemeinsame Dateienesser-effeff SharedEvent
ProtocolEvent_Protokoll.ocx (1)
// IIDLCID: {B2DD83C5-9D33-11D1-8ECA-500012356402}
// Helpfile: C:WINNTSystem32Event_Protokoll.hlp
// DepndLst:
// (1) v2.0 stdole, (C:WINNTSystem32stdole2.tlb)
// (2) v4.0 StdVCL, (C:WINNTSystem32STDVCL40.DLL)
// ************************************************************************
//
#include <vcl.h>
#pragma hdrstop
#if defined(USING_ATL)
#include <atlatlvcl.h>
#endif
#include "EVENT_PROTOKOLLLib_OCX.h"
#if !defined(__PRAGMA_PACKAGE_SMART_INIT)
#define __PRAGMA_PACKAGE_SMART_INIT
#pragma package(smart_init)
#endif
namespace Event_protokolllib_tlb
{
// *********************************************************************//
// OCX PROXY CLASS IMPLEMENTATION
// (The following variables/methods implement the class TEvent_Protokoll
which
// allows "Event_Protokoll Control" to be hosted in CBuilder IDE/apps).
// *********************************************************************//
int TEvent_Protokoll::EventDispIDs[2] = {
0x00000001, 0x00000002};
TControlData TEvent_Protokoll::CControlData =
{
// GUID of CoClass and Event Interface of Control
{0xB2DD83C8, 0x9D33, 0x11D1,{ 0x8E, 0xCA, 0x50, 0x00, 0x12, 0x35, 0x64,
0x02} }, // CoClass
{0xB2DD83C7, 0x9D33, 0x11D1,{ 0x8E, 0xCA, 0x50, 0x00, 0x12, 0x35, 0x64,
0x02} }, // Events
// Count of Events and array of their DISPIDs
2, &EventDispIDs,
// Pointer to Runtime License string
NULL, // HRESULT(0x80004005)
// Flags for OnChanged PropertyNotification
0x00000000,
300,// (IDE Version)
// Count of Font Prop and array of their DISPIDs
0, NULL,
// Count of Pict Prop and array of their DISPIDs
0, NULL,
0, // Reserved
0, // Instance count (used internally)
0, // List of Enum descriptions (internal)
};
GUID TEvent_Protokoll::DEF_CTL_INTF = {0xB2DD83C6, 0x9D33, 0x11D1,{
0x8E, 0xCA, 0x50, 0x00, 0x12, 0x35, 0x64, 0x02} };
TNoParam TEvent_Protokoll::OptParam;
static inline void ValidCtrCheck(TEvent_Protokoll *)
{
delete new TEvent_Protokoll((TComponent*)(0));
};
void __fastcall TEvent_Protokoll::InitControlData()
{
ControlData = &CControlData;
};
void __fastcall TEvent_Protokoll::CreateControl()
{
if (!m_OCXIntf)
{
_ASSERTE(DefaultDispatch);
DefaultDispatch->QueryInterface(DEF_CTL_INTF, (LPVOID*)&m_OCXIntf);
}
};
_DEvent_ProtokollDisp __fastcall TEvent_Protokoll::GetDefaultInterface()
{
CreateControl();
return m_OCXIntf;
};
BSTR __fastcall TEvent_Protokoll::GetInitStringEventProtocol(void)
{
return GetDefaultInterface()->GetInitStringEventProtocol();
}
TOLEBOOL __fastcall TEvent_Protokoll::InitEventProtocol(BSTR* pInitString)
{
return GetDefaultInterface()->InitEventProtocol(pInitString);
}
short __fastcall TEvent_Protokoll::CanWrite(long Mva, short* HKeyMva, long
Dva, short* HKeyDva,
short HKeyAWP, long OutDataLen)
{
return GetDefaultInterface()->CanWrite(Mva, HKeyMva, Dva, HKeyDva,
HKeyAWP, OutDataLen);
}
short __fastcall TEvent_Protokoll::QuitRead(long Mva, short* HKeyMva, long
Dva, short* HKeyDva,
short HKeyAWP, long MsgKey)
{
return GetDefaultInterface()->QuitRead(Mva, HKeyMva, Dva, HKeyDva,
HKeyAWP, MsgKey);
}
void __fastcall TEvent_Protokoll::Close(void)
{
GetDefaultInterface()->Close();
}
BSTR __fastcall TEvent_Protokoll::GetVersion(void)
{
return GetDefaultInterface()->GetVersion();
}
TOLEBOOL __fastcall TEvent_Protokoll::SetClientManagement(short DriverIndex,
short ClientIndex)
{
return GetDefaultInterface()->SetClientManagement(DriverIndex,
ClientIndex);
}
TOLEBOOL __fastcall TEvent_Protokoll::SetClientManagementVAddress(short
VAddress)
{
return GetDefaultInterface()->SetClientManagementVAddress(VAddress);
}
short __fastcall TEvent_Protokoll::GetDriverCount(void)
{
return GetDefaultInterface()->GetDriverCount();
}
short __fastcall TEvent_Protokoll::GetClientCount(short MyVAddrIndex)
{
return GetDefaultInterface()->GetClientCount(MyVAddrIndex);
}
BSTR __fastcall TEvent_Protokoll::GetClientName(short MyVAddrIndex, short
ClientIndex)
{
return GetDefaultInterface()->GetClientName(MyVAddrIndex, ClientIndex);
}
short __fastcall TEvent_Protokoll::GetClientVAddress(short MyVAddrIndex,
short ClientIndex)
{
return GetDefaultInterface()->GetClientVAddress(MyVAddrIndex,
ClientIndex);
}
TOLEBOOL __fastcall TEvent_Protokoll::SetCurSel(short DriverIndex, short
MyVAddrIndex,
short ClientIndex)
{
return GetDefaultInterface()->SetCurSel(DriverIndex, MyVAddrIndex,
ClientIndex);
}
void __fastcall TEvent_Protokoll::GetCurSel(short* DriverIndex, short*
MyVAddrIndex,
short* ClientIndex)
{
GetDefaultInterface()->GetCurSel(DriverIndex, MyVAddrIndex, ClientIndex);
}
short __fastcall TEvent_Protokoll::GetEPVAddress(void)
{
return GetDefaultInterface()->GetEPVAddress();
}
TOLEBOOL __fastcall TEvent_Protokoll::GetClientManagement(void)
{
return GetDefaultInterface()->GetClientManagement();
}
TOLEBOOL __fastcall TEvent_Protokoll::GetClientIndex(short VAddress, short
MyVAddrIndex,
short* ClientIndex)
{
return GetDefaultInterface()->GetClientIndex(VAddress, MyVAddrIndex,
ClientIndex);
}
BSTR __fastcall TEvent_Protokoll::GetDriverName(short DriverIndex)
{
return GetDefaultInterface()->GetDriverName(DriverIndex);
}
long __fastcall TEvent_Protokoll::Open(void)
{
return GetDefaultInterface()->Open();
}
short __fastcall TEvent_Protokoll::Write(long Mva, short* HKeyMva, long Dva,
short* HKeyDva,
short HKeyAWP, long DataID,
TOLEBOOL WishAnswer,
TVariant* OutData, long* WriteID)
{
return GetDefaultInterface()->Write(Mva, HKeyMva, Dva, HKeyDva, HKeyAWP,
DataID, WishAnswer,
OutData, WriteID);
}
TOLEBOOL __fastcall TEvent_Protokoll::Read(long* Mva, long* Dva, short*
HKeyAWP, long* DataID,
long* MsgKey, short*
RecoveryInfo, TVariant* InData,
long* InDataLen)
{
return GetDefaultInterface()->Read(Mva, Dva, HKeyAWP, DataID, MsgKey,
RecoveryInfo, InData,
InDataLen);
}
short __fastcall TEvent_Protokoll::GetMyVAddressCount(void)
{
return GetDefaultInterface()->GetMyVAddressCount();
}
short __fastcall TEvent_Protokoll::GetMyVAddress(short MyVAddrIndex)
{
return GetDefaultInterface()->GetMyVAddress(MyVAddrIndex);
}
TOLEBOOL __fastcall TEvent_Protokoll::ReadMessage(long* Msg, long* Mva,
short* HKeyMva, long* Dva,
short* HKeyDva, short*
HKeyAWP, long* WriteID,
short* LiveState, short*
UseHKey)
{
return GetDefaultInterface()->ReadMessage(Msg, Mva, HKeyMva, Dva, HKeyDva,
HKeyAWP, WriteID,
LiveState, UseHKey);
}
void __fastcall TEvent_Protokoll::CanReceiveData(long Mva, short* HKeyMva,
long Dva, short* HKeyDva,
short HKeyAWP, TOLEBOOL
bnewValue)
{
GetDefaultInterface()->CanReceiveData(Mva, HKeyMva, Dva, HKeyDva, HKeyAWP,
bnewValue);
}
}; // namespace Event_protokolllib_tlb
// *********************************************************************//
// The Register function is invoked by the IDE when this module is
// installed in a Package. It provides the list of Components (including
// OCXes) implemented by this module. The following implementation
// informs the IDE of the OCX proxy classes implemented here.
// *********************************************************************//
namespace Event_protokolllib_ocx
{
void __fastcall PACKAGE Register()
{
// [1]
TComponentClass cls_ocx[] = {
__classid(Event_protokolllib_tlb::TEvent_Protokoll)
};
RegisterComponents("ActiveX", cls_ocx,
sizeof(cls_ocx)/sizeof(cls_ocx[0])-1);
}
}; // namespace Event_protokolllib_ocx
---
Here all the functions or methods from the ocx are (so I think) properly
imported. To put this file simply into CBuilder6/imports does not work (This
would be too easy).
Harald
|
|
| Back to top |
|
 |
David Guest
|
Posted: Fri Apr 15, 2005 12:18 pm Post subject: Re: Importing ActiveX to BCB6 |
|
|
Hi,
I have the same problem! You recommended a beta importer but that article
was from 2002 and the Service Pack 4 is from 2003 so the beta version
shouldn´t be used according to me.
My header files are also wrong generated. In BCB5 some types are TVariant
but in BCB6 the types are just VARIANT. I think that it has something to do
with Wrappers...
Is the latest patch, service path 4? And have you seen other betas? Have you
fixed your problems?
-> David
"Harald Plontke" <news (AT) plontke (DOT) de> skrev i meddelandet
news:4238a005 (AT) newsgroups (DOT) borland.com...
| Quote: | Hello,
The latest one, and the one that I recommend trying, is this one:
http://bdn.borland.com/article/0,1410,29110,00.html
I tried it, but it imports nothing from the ocx. Sorry about the long
sourcecode, I hope you can read through it:
The EVENT_PROTOKOLLLib_OCX.h imported with the new beta version looks
like:
---
//
************************************************************************
//
// WARNUNG
// -------
// Die in dieser Datei deklarierten Typen wurden aus Daten einer
Typbibliothek
// generiert. Wenn diese Typbibliothek explizit oder indirekt (über eine
// andere Typbibliothek) reimportiert wird oder wenn die Anweisung
// 'Aktualisieren' im Typbibliotheks-Editor während des Bearbeitens der
// Typbibliothek aktiviert ist, wird der Inhalt dieser Datei neu generiert
und
// alle manuell vorgenommenen Änderungen gehen verloren.
//
************************************************************************
//
// C++ TLBWRTR : $Revision: 1.151.1.0.1.21 $
// Datei generiert am 16.03.2005 21:49:39 aus der unten beschriebenen
Typbibliothek.
//
************************************************************************
//
// Typbib: E:DatenProjekteIDCDiverse DateienEffeff
EventprotokollEvent_Protokoll.ocx (1)
// LIBID: {B2DD83C5-9D33-11D1-8ECA-500012356402}
// LCID: 0
// Hilfedatei: E:DatenProjekteIDCDiverse DateienEffeff
EventprotokollEvent_Protokoll.hlp
// Hilfe-String: Event_Protokoll ActiveX Control module
// DepndLst:
// (1) v2.0 stdole, (C:WINNTSystem32STDOLE2.TLB)
//
************************************************************************
//
#include <vcl.h
#pragma hdrstop
#include
#include
#if defined(USING_ATL)
#include
#endif
#include "EVENT_PROTOKOLLLib_OCX.h"
#if !defined(__PRAGMA_PACKAGE_SMART_INIT)
#define __PRAGMA_PACKAGE_SMART_INIT
#pragma package(smart_init)
#endif
namespace Event_protokolllib_tlb
{
}; // namespace Event_protokolllib_tlb
---
but in BCB5 it looks:
---
//
************************************************************************
//
// 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.134.1.39 $
// File generated on 09.11.2003 18:47:00 from Type Library described
below.
//
************************************************************************
//
// Type Lib: C:ProgrammeGemeinsame Dateienesser-effeff SharedEvent
ProtocolEvent_Protokoll.ocx (1)
// IIDLCID: {B2DD83C5-9D33-11D1-8ECA-500012356402}
// Helpfile: C:WINNTSystem32Event_Protokoll.hlp
// DepndLst:
// (1) v2.0 stdole, (C:WINNTSystem32stdole2.tlb)
// (2) v4.0 StdVCL, (C:WINNTSystem32STDVCL40.DLL)
//
************************************************************************
//
#include
#pragma hdrstop
#if defined(USING_ATL)
#include
#endif
#include "EVENT_PROTOKOLLLib_OCX.h"
#if !defined(__PRAGMA_PACKAGE_SMART_INIT)
#define __PRAGMA_PACKAGE_SMART_INIT
#pragma package(smart_init)
#endif
namespace Event_protokolllib_tlb
{
// *********************************************************************//
// OCX PROXY CLASS IMPLEMENTATION
// (The following variables/methods implement the class TEvent_Protokoll
which
// allows "Event_Protokoll Control" to be hosted in CBuilder IDE/apps).
// *********************************************************************//
int TEvent_Protokoll::EventDispIDs[2] = {
0x00000001, 0x00000002};
TControlData TEvent_Protokoll::CControlData =
{
// GUID of CoClass and Event Interface of Control
{0xB2DD83C8, 0x9D33, 0x11D1,{ 0x8E, 0xCA, 0x50, 0x00, 0x12, 0x35, 0x64,
0x02} }, // CoClass
{0xB2DD83C7, 0x9D33, 0x11D1,{ 0x8E, 0xCA, 0x50, 0x00, 0x12, 0x35, 0x64,
0x02} }, // Events
// Count of Events and array of their DISPIDs
2, &EventDispIDs,
// Pointer to Runtime License string
NULL, // HRESULT(0x80004005)
// Flags for OnChanged PropertyNotification
0x00000000,
300,// (IDE Version)
// Count of Font Prop and array of their DISPIDs
0, NULL,
// Count of Pict Prop and array of their DISPIDs
0, NULL,
0, // Reserved
0, // Instance count (used internally)
0, // List of Enum descriptions (internal)
};
GUID TEvent_Protokoll::DEF_CTL_INTF = {0xB2DD83C6, 0x9D33, 0x11D1,{
0x8E, 0xCA, 0x50, 0x00, 0x12, 0x35, 0x64, 0x02} };
TNoParam TEvent_Protokoll::OptParam;
static inline void ValidCtrCheck(TEvent_Protokoll *)
{
delete new TEvent_Protokoll((TComponent*)(0));
};
void __fastcall TEvent_Protokoll::InitControlData()
{
ControlData = &CControlData;
};
void __fastcall TEvent_Protokoll::CreateControl()
{
if (!m_OCXIntf)
{
_ASSERTE(DefaultDispatch);
DefaultDispatch->QueryInterface(DEF_CTL_INTF, (LPVOID*)&m_OCXIntf);
}
};
_DEvent_ProtokollDisp __fastcall TEvent_Protokoll::GetDefaultInterface()
{
CreateControl();
return m_OCXIntf;
};
BSTR __fastcall TEvent_Protokoll::GetInitStringEventProtocol(void)
{
return GetDefaultInterface()->GetInitStringEventProtocol();
}
TOLEBOOL __fastcall TEvent_Protokoll::InitEventProtocol(BSTR* pInitString)
{
return GetDefaultInterface()->InitEventProtocol(pInitString);
}
short __fastcall TEvent_Protokoll::CanWrite(long Mva, short* HKeyMva, long
Dva, short* HKeyDva,
short HKeyAWP, long
OutDataLen)
{
return GetDefaultInterface()->CanWrite(Mva, HKeyMva, Dva, HKeyDva,
HKeyAWP, OutDataLen);
}
short __fastcall TEvent_Protokoll::QuitRead(long Mva, short* HKeyMva, long
Dva, short* HKeyDva,
short HKeyAWP, long MsgKey)
{
return GetDefaultInterface()->QuitRead(Mva, HKeyMva, Dva, HKeyDva,
HKeyAWP, MsgKey);
}
void __fastcall TEvent_Protokoll::Close(void)
{
GetDefaultInterface()->Close();
}
BSTR __fastcall TEvent_Protokoll::GetVersion(void)
{
return GetDefaultInterface()->GetVersion();
}
TOLEBOOL __fastcall TEvent_Protokoll::SetClientManagement(short
DriverIndex,
short ClientIndex)
{
return GetDefaultInterface()->SetClientManagement(DriverIndex,
ClientIndex);
}
TOLEBOOL __fastcall TEvent_Protokoll::SetClientManagementVAddress(short
VAddress)
{
return GetDefaultInterface()->SetClientManagementVAddress(VAddress);
}
short __fastcall TEvent_Protokoll::GetDriverCount(void)
{
return GetDefaultInterface()->GetDriverCount();
}
short __fastcall TEvent_Protokoll::GetClientCount(short MyVAddrIndex)
{
return GetDefaultInterface()->GetClientCount(MyVAddrIndex);
}
BSTR __fastcall TEvent_Protokoll::GetClientName(short MyVAddrIndex, short
ClientIndex)
{
return GetDefaultInterface()->GetClientName(MyVAddrIndex, ClientIndex);
}
short __fastcall TEvent_Protokoll::GetClientVAddress(short MyVAddrIndex,
short ClientIndex)
{
return GetDefaultInterface()->GetClientVAddress(MyVAddrIndex,
ClientIndex);
}
TOLEBOOL __fastcall TEvent_Protokoll::SetCurSel(short DriverIndex, short
MyVAddrIndex,
short ClientIndex)
{
return GetDefaultInterface()->SetCurSel(DriverIndex, MyVAddrIndex,
ClientIndex);
}
void __fastcall TEvent_Protokoll::GetCurSel(short* DriverIndex, short*
MyVAddrIndex,
short* ClientIndex)
{
GetDefaultInterface()->GetCurSel(DriverIndex, MyVAddrIndex,
ClientIndex);
}
short __fastcall TEvent_Protokoll::GetEPVAddress(void)
{
return GetDefaultInterface()->GetEPVAddress();
}
TOLEBOOL __fastcall TEvent_Protokoll::GetClientManagement(void)
{
return GetDefaultInterface()->GetClientManagement();
}
TOLEBOOL __fastcall TEvent_Protokoll::GetClientIndex(short VAddress, short
MyVAddrIndex,
short* ClientIndex)
{
return GetDefaultInterface()->GetClientIndex(VAddress, MyVAddrIndex,
ClientIndex);
}
BSTR __fastcall TEvent_Protokoll::GetDriverName(short DriverIndex)
{
return GetDefaultInterface()->GetDriverName(DriverIndex);
}
long __fastcall TEvent_Protokoll::Open(void)
{
return GetDefaultInterface()->Open();
}
short __fastcall TEvent_Protokoll::Write(long Mva, short* HKeyMva, long
Dva,
short* HKeyDva,
short HKeyAWP, long DataID,
TOLEBOOL WishAnswer,
TVariant* OutData, long* WriteID)
{
return GetDefaultInterface()->Write(Mva, HKeyMva, Dva, HKeyDva, HKeyAWP,
DataID, WishAnswer,
OutData, WriteID);
}
TOLEBOOL __fastcall TEvent_Protokoll::Read(long* Mva, long* Dva, short*
HKeyAWP, long* DataID,
long* MsgKey, short*
RecoveryInfo, TVariant* InData,
long* InDataLen)
{
return GetDefaultInterface()->Read(Mva, Dva, HKeyAWP, DataID, MsgKey,
RecoveryInfo, InData,
InDataLen);
}
short __fastcall TEvent_Protokoll::GetMyVAddressCount(void)
{
return GetDefaultInterface()->GetMyVAddressCount();
}
short __fastcall TEvent_Protokoll::GetMyVAddress(short MyVAddrIndex)
{
return GetDefaultInterface()->GetMyVAddress(MyVAddrIndex);
}
TOLEBOOL __fastcall TEvent_Protokoll::ReadMessage(long* Msg, long* Mva,
short* HKeyMva, long* Dva,
short* HKeyDva, short*
HKeyAWP, long* WriteID,
short* LiveState, short*
UseHKey)
{
return GetDefaultInterface()->ReadMessage(Msg, Mva, HKeyMva, Dva,
HKeyDva,
HKeyAWP, WriteID,
LiveState, UseHKey);
}
void __fastcall TEvent_Protokoll::CanReceiveData(long Mva, short* HKeyMva,
long Dva, short* HKeyDva,
short HKeyAWP, TOLEBOOL
bnewValue)
{
GetDefaultInterface()->CanReceiveData(Mva, HKeyMva, Dva, HKeyDva,
HKeyAWP,
bnewValue);
}
}; // namespace Event_protokolllib_tlb
// *********************************************************************//
// The Register function is invoked by the IDE when this module is
// installed in a Package. It provides the list of Components (including
// OCXes) implemented by this module. The following implementation
// informs the IDE of the OCX proxy classes implemented here.
// *********************************************************************//
namespace Event_protokolllib_ocx
{
void __fastcall PACKAGE Register()
{
// [1]
TComponentClass cls_ocx[] = {
__classid(Event_protokolllib_tlb::TEvent_Protokoll)
};
RegisterComponents("ActiveX", cls_ocx,
sizeof(cls_ocx)/sizeof(cls_ocx[0])-1);
}
}; // namespace Event_protokolllib_ocx
---
Here all the functions or methods from the ocx are (so I think) properly
imported. To put this file simply into CBuilder6/imports does not work
(This
would be too easy).
Harald
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Apr 15, 2005 5:12 pm Post subject: Re: Importing ActiveX to BCB6 |
|
|
"David" <davan408 (AT) student (DOT) liu.se> wrote
| Quote: | My header files are also wrong generated. In BCB5 some
types are TVariant but in BCB6 the types are just VARIANT.
|
In BCB6, Borland changed the TypeLibrary support to use raw interfaces and
raw VARIANTS, not wrapper classes anymore. They proved to be too
problematic, especially when using the COM objects in non-Borland
environments.
Gambit
|
|
| Back to top |
|
 |
David Guest
|
Posted: Fri Apr 15, 2005 6:47 pm Post subject: Re: Importing ActiveX to BCB6 |
|
|
Hi,
Ok, so do you think that it is the vendors of the OCX that haven't built it
correctly in BCB6 or even at all? They only ship examples in BCB5 but they
still claim that it works in BCB6...
In my case there is an interface to a PCI digital I/O where it works to read
the port but the write function always return false. The write functions
earlier (in BCB5) took a TVariant converted directly from a VARIANT as a
parameter. Now the function takes a VARIANT as a parameter. I use the same
code as earlier without converting the array to a TVariant. But it doesn't
work!
The functions returns VARIANT_BOOL instead of TOLEBOOL but I made a
conversion that works with the read function.
Do you have any comment or ideas on this?
Thank you!
-> David
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> skrev i meddelandet
news:425ff5f1$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"David" <davan408 (AT) student (DOT) liu.se> wrote in message
news:425fb07d (AT) newsgroups (DOT) borland.com...
My header files are also wrong generated. In BCB5 some
types are TVariant but in BCB6 the types are just VARIANT.
In BCB6, Borland changed the TypeLibrary support to use raw interfaces and
raw VARIANTS, not wrapper classes anymore. They proved to be too
problematic, especially when using the COM objects in non-Borland
environments.
Gambit
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Apr 15, 2005 9:00 pm Post subject: Re: Importing ActiveX to BCB6 |
|
|
"David" <davan408 (AT) student (DOT) liu.se> wrote
| Quote: | In my case there is an interface to a PCI digital I/O where it works to
read the port but the write function always return false. The write
functions
earlier (in BCB5) took a TVariant converted directly from a VARIANT
as a parameter. Now the function takes a VARIANT as a parameter. I
use the same code as earlier without converting the array to a TVariant.
But it doesn't work!
|
Just saying it doesn't work says nothing about the actual problem that is
occuring. What does the actual code look like? Has anyone tried debugging
the OCX yet?
Gambit
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|