Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / February 2008



Tip: Looking for answers? Try searching our database.

Addressing an underlying C++ class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Harding - 21 Feb 2008 17:01 GMT
We have a COM library supplied by a hardware vendor contained in let's say
vendor.dll.  The vendor SDK also contains header files and libraries for C++
development again using vendor.dll.  It turns out that the COM implementation
is lacking certain functions which we need.  The vendor's  first support
response was that we should use the C/C++ API for the missing functions.  
Unfortunately we are not certain how to proceed.  Here is the scenario.  
Let's call our COM object in VB6 CodeviceObject.  (This object represents a
hardware device which we want to control via our software.)  From the C/C++
header files we find the method which we need to declare, call it
DeviceMethod.  Now DeviceMethod takes what we'll call a deviceObject as a
parameter where deviceObject actually instantiates a Java class exposed to
the C++ API via JNI.  Calling DeviceMethod with the COM object CodeviceObject
will lead to a crash.  deviceObject as defined in the C++ header files is a
fairly complicated object, and it's not at all clear how to define a type in
VB that would allow us to instantiate a C++/Java device object.  It seems
like there should be a deviceObject loaded in memory somewhere created by our
CodeviceObject in VB.  Is there some straightforward way to sort of pierce
through the COM stuff and point to that deviceObject (something like
ObjPtr(CoDeviceObject) + StandardvOffset) so that we can call DeviceMethod
successfully?
Brian Muth - 21 Feb 2008 17:08 GMT
> We have a COM library supplied by a hardware vendor contained in let's say
> vendor.dll.  The vendor SDK also contains header files and libraries for C++
[quoted text clipped - 16 lines]
> ObjPtr(CoDeviceObject) + StandardvOffset) so that we can call DeviceMethod
> successfully?

It strikes me as being quite straightforward to add an interface, implemented in C++, that provides methods for instantiating and
deleting deviceObject on behalf of the VB6 client.

Brian
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.