Re: VB6 Regfree Com



Hi,

Anthony wrote:

...
For clarification, here is what I would like to do.

1) Place all DLL and OCX files in app directory, and create the appname.exe.local file to force the exe to use local files
2) Use Regfree COM to get those registered on the fly (I *do* need to do this, right?)

Is this possible? This seemingly simply thing that would make things soooo easy? Can anyone point me to a good article on how to do this (complete with CLSID's) for the Regfee com manifests)?

There is a ready to use, very small and *free* dll (named DirectCOM.Dll), specifically tailored for the use with VB6. Get it from

http://www.thecommon.net/10.html

The dll itself is a standard (non COM server) dll and needs no registering. Put it in your applications path (simplest) or anywhere else. It allows you to instantiate objects from COM servers *without* the need to register them. There is a CreateObject method for this, which needs the prog id of the class.

The COM server file may be anywhere on disk, not necessarily in the application directory. You even can use multiple versions of a COM server side by side. Or distribute your own copy of an eg MS control, such beeing sure using the correct version, no matter wether the control (possibly with an other version than yours) already exists and is registered on the pc. Of course you also can use a registered COM server with this dll, it does not matter. The point is: the COM server may be unregistered, and stays unregistered when used with DirectCOM.Dll.

The dll uses standard, completely legal win api calls. There is nothing peculiar with the inner working of the dll, no hacks, just using official, legal methods. It is little known that Windows allows using of COM objects that have not been registered. Registering is not necessary for using COM objects, it just helps finding the necessary informations for instantiating.

For best comfort during development the procedure would be:

- Register the COM server you want to use *on the development pc*.
- In the VB IDE add a reference to it.

Above two steps are the same as with normal, not reg free, development. Now the COM server can be used as usual, getting all he comfort like intellisense and so on. The only difference is that for instantiating you must not use VBs New operator or VBs CreateObject method. Instead you use the the DirectCOM.dlls CreateObject method.

- When development has finished, deploy the application, the COM server and the DirectCOM.dll to the target system by just copying them to the target system (real xcopy deployment). On the target system there is no need to register the COM server! But of course the VB runtime with its supporting files must be present, as usal.

--
Ulrich Korndoerfer

VB tips, helpers, solutions -> http://www.proSource.de/Downloads/
.



Relevant Pages

  • Re: VB6 Regfree Com
    ... MSVBVM60.DLL is on the target machine, then I can just include this DLL, the ... The COM server file may be anywhere on disk, ... Register the COM server you want to use *on the development pc*. ...
    (microsoft.public.vb.general.discussion)
  • Re: runtime error 800a0030 when executing vbscript from w2k. Works
    ... The COM server (it is not DLL, but out proc exe) is registered on both ... I forgot to mention more about the enviroment, but basically the COM Server ... > Does the dll register correctly as a COM component? ...
    (microsoft.public.scripting.vbscript)
  • Re: Registering DLL issue.
    ... working fine, with it pointed to the system32 folder, can't explain it ... system32 drive and use regsvr32 to register it. ... are pointing to the dll on the network drive and not the dll i ... All of my source is on our server so it's backed up every night. ...
    (microsoft.public.vb.general.discussion)
  • Re: Help in WMI in ASP.net application
    ... In my option you did the correct thing by creating a COM+ DLL. ... step I see you missing is that you need to register the DLL in COM+. ... The parameters that we pass or the server name (the host ... > well as from a remote machine it is giving the correct result. ...
    (microsoft.public.scripting.wsh)
  • Re: Updating CDO.DLL on BlackBerry Server
    ... > After applying the 828429 hotfix to our Exchange server, ... > BES must match or exceed that of the CDO.DLL on the ... must the DLL file be in the correct location ... because the location that you register it from is also saved as part of the ...
    (microsoft.public.exchange.admin)

Loading