tags:

views:

269

answers:

3

I'm learning how to create an VB6 Active X EXE. (I need to add the ability for a number of VB6 apps to "phone home" to a server and I'd like centralize this but don't want to do it with a DLL because I'd like to only need Firewall permission for one program (the "phone home ActiveX EXE).

I've found a few tutorials but I'm looking for a downloadable project to "play around with".

A: 

check these:

http://www.codeproject.com/KB/COM/CompleteActiveX.aspx

http://msdn.microsoft.com/en-us/library/c6hzbzz6(VS.80).aspx

http://pages.cpsc.ucalgary.ca/~saul/vb_examples/tutorial10/activex01.html

VoodooChild
Voodo:First example is VB.netSecond is C++Third is an Active X *control* (inside an Active X EXE), which is a more complicated example that I was looking for.
Clay Nichols
Correction: the third example is an Active X *control* not an ActiveX EXE.So none of these is what I was asking for.
Clay Nichols
A: 

A tutorial and a project: the VB6 documentation has a good tutorial Creating an ActiveX EXE Component.

A more detailed version of the project is available in the samples that come with VB6. I can't find it available for download - have a look in your VB6 install directory or on the CD.

Dan Appleman's excellent book Developing COM/ActiveX components with Visual Basic 6 has good in-depth coverage of ActiveX exes. You can usually pick it up second hand very cheaply.

MarkJ
The first and two suggestions seem to be based on the same project, which I could only find in my VB6 install directory.BUT the instructions have one step that seems impossible:Start another instance of Visual Basic, and load CoffWat2.vbp. On the Project menu, select References to open the References dialog box. Select Coffee2 (make sure you get the entry for Coffee2.vbp (YOU CAN'T ADD A REFERENCE TO A .VBP FILE)) and MTCoffee (make sure you get the entry for MTCoffee.exe), and then click OK, to set references to the components.
Clay Nichols
A: 

This one worked well: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=52172&lngWId=1

This one technicall worked (as an ActiveX EXE) but couldn't get it to actually do the work the ActiveX EXE was supposed to do (download files) : http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=28667&lngWId=1

Tip to allow you to debug both the Host and Server (ActiveX EXE) in VB6:

  1. You'll have two VBP project files: one for the ActiveX EXE "server" and one for the host app calling it.
  2. Load each into separate VB6 IDE instances.
  3. Run the ActiveX one first.
  4. In the second one, add the ActiveX VBP file (not the .exe) as a reference: (Project > References> Browse... and add the vbp file.
Clay Nichols