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".

Bradley Mountford
  • 8,195
  • 4
  • 41
  • 41
Clay Nichols
  • 11,848
  • 30
  • 109
  • 170
  • I'm not sure what ActiveX has to do with this. If you have firewall permission there are fairly straightforward ways to send UDP or TCP packets back and forth across the wire. This is true regardless of the architecture of the EXE. – Robert Harvey May 21 '10 at 22:57
  • Robert, a suite of 18 programs will need to access the server. Rather than having to tell the the IT person managing that computer to run *each* of those 18 programs and click the "Allow Inet access for ProgramX" (and risking s/he will forget one and then having a non techie customer then try to run it the next day and ignore the Firewall "do you want to allow" msg"), I'd prefer to funnel all Inet through ONE ActiveX control which means the customer giving firewall permission *once*. – Clay Nichols May 21 '10 at 23:25
  • If the ActiveX EXE will live on the server, consider that DCOM will have to be allowed through the firewall and that's per-machine, not granular by application. If it will live on each client I doubt it helps because only a local software firewall has any knowledge of the application involved. Network firewalls only know ports and IP addresses, and though there are exceptions that "peek inside" at traffic I doubt many are DCOM-savvy... or are you talking about the local software firewall at each client? In that case your installer can add firewall exceptions for your programs. – Bob77 May 22 '10 at 00:53
  • Yes, Bob, I'm talking about local firewalls. (This will be downloading a file from a server so I suspect to any firewall other than the one *on* the PC this will look the same as a web browser download). How do you do that? I've posted this as a new question: http://stackoverflow.com/questions/2886604/how-do-you-add-firewall-permission-to-an-app-during-installation – Clay Nichols May 22 '10 at 01:44
  • Ok. I've posted a response there that I hope will help. – Bob77 May 23 '10 at 18:29

3 Answers3

0

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
  • 30,070
  • 5
  • 68
  • 111
  • 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 May 22 '10 at 13:47
0

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
  • 11,848
  • 30
  • 109
  • 170
-1

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
  • 9,776
  • 8
  • 66
  • 99
  • Voodo: First example is VB.net Second 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 May 21 '10 at 23:13
  • 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 May 21 '10 at 23:22