How to automate the process of registering ATL object ?

How to automate the process of registering ATL object ?

Post by ajay » Sat, 08 Jan 2005 22:39:08


Hello There
Let me explain my problem first. I have developed one application in
which I'm using one ATL component which downloads URL from web. Before
to run my application, I always have to register DLL using regsvr32.
Thats fine if I'm doing it on my machine. How can I automate this
process of registering DLL using my application ? Well My application
is a seaprate EXE, So we are going to distrubute it without setup.
Means it will be a seaprate EXE which user will download and run to
start it. How can I pack my DLL with it ? Can I keep my DLL as a
resource in EXE and register it when application is started.
( Somethging like this - I will extract DLL from resource and register
it before to start ),
Can I do something like this ? If yes, how can I ?
 
 
 

How to automate the process of registering ATL object ?

Post by Brian Mut » Sun, 09 Jan 2005 01:22:14

I would think a simple CAB file would give you what you need. There is lots
of information in the MSDN Library on how to build CAB files.

Brian

 
 
 

How to automate the process of registering ATL object ?

Post by Ajay Kalr » Sun, 09 Jan 2005 03:17:30

Any installation program will do this(registration). If you want to do
it yourself, write a batch file which call Regsvr32. You can force the
registration at installation by calling the batch file. You can also do
the registration in your exe if you cannot cocreate it.

One technique that we followed because we had a good number (over 10)
of COM objects which needed registration, was simply to create a COM
server which registers the other com objects when the server is
registered. That avoided registering each COM object individually.

----------
Ajay Kalra
XXXX@XXXXX.COM


Before
register
 
 
 

How to automate the process of registering ATL object ?

Post by Jerry Coff » Tue, 18 Jan 2005 15:50:24

In article < XXXX@XXXXX.COM >,
XXXX@XXXXX.COM says...


Registering a COM DLL simply consists of calling the DLL's
"DLLRegisterServer" function. Omitting error checking for clarity, it
looks like this:

HMODULE mod = LoadLibrary(dll_path);
int (__stdcall *register_dll)() =
GetProcAddress(mod, "DllRegisterServer");
register_dll();

Yes, regsvr32 must be a truly trivial program -- I'd guess nearly all
of it is devoted to parsing the command line...

--
Later,
Jerry.

The universe is a figment of its own imagination.