Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: ActiveX DLL, COM


Message #1 by "Hanson Lam" <hansonlam@h...> on Fri, 22 Jun 2001 06:59:52
Hanson,

You can use VB created ActiveX DLL's in C/C++ as they are fully fledged COM
objects. The common interface between the two is the fact that data types in
VB map one-to-one to the OLE defined data types (i.e. native COM types) in
most cases, although I'm not 100% sure about variant arrays. 

ATL and other microsoft 'goodies' provide alot of function calls etc which
allow you to manipulate these com types using library calls so there
shouldn't be a problem handing values between then providing you use these
function calls/macros rather than direct manipulation (i.e. using pointers
etc to access string contents).

COM marshalls data into a representation which can be transferred between
threads, processes and even different physical machines over a network
without having to re-write your component to know about how it is being used
or where it is being called from. A sort-of example of this is properties,
where instead of just declaring a variable as 'Public' microsoft have used
the get/let/set wrapper to perform different marshalling etc without having
to re-code your apps.

Another cool way to use this is to write an NT Service controller service
using c/c++ and the call functionality which lives in an ActiveX DLL or EXE
- getting around the many problems with trying to get VB applications to run
as an unattended service.

Hope this helps.
Steve

> -----Original Message-----
> From: Hanson Lam [mailto:hansonlam@h...]
> Sent: 22 June 2001 08:00
> To: professional vb
> Subject: [pro_vb] ActiveX DLL, COM
> 
> 
> Hello:
> 
> A quick question about ActiveX DLLs.  I've built ActiveX DLLs 
> for use in n-
> tier applications, and have used the same object in an ASP 
> version of the 
> application.  My question is, these components are basically COM 
> components, and can be used in C++ applications right?  Am I assuming 
> correctly?
> 
> What about variable types?  If one of my methods returns a variant 
> (array), would a C++ app be able to manipulate it?
> 
> I'm not familiar with C++....
> 
> Any other general insight into component development with VB 
> / for use 
> across languages is appreciated.
> 
> Thanks in advance.
> 
> Hanson
> 

  Return to Index