Re: Accessing a DLL without registering it



There are several ways that I can think of offhand

You could simply try to create an object from one of the classes in the dll,
and trap the error. If it cannot create the class, then it is probably not
registered.

You could use tlbinf32.dll to inspect the registered component, and see if
it's there.

You can directly check for the CLSID in the registry.

The easiest may be to just try and create the object, and trap the error.


"Thomas Malia" <tommalia@xxxxxxxxxxxxxxxx> wrote in message
news:%23$v2IEVSHHA.1364@xxxxxxxxxxxxxxxxxxxxxxx
OK, that sound good so far, but what about checking to see in the file is
already registered or not? Or is it a case where, if the files already
registered, and yhe regsrv32.exe is run for it again, it basically does
nothing so no harm done?

"Lance Wynn" <LanceWynn@xxxxxxxxxxxxxxxx> wrote in message
news:uvlaD4USHHA.5016@xxxxxxxxxxxxxxxxxxxxxxx
You can just shell regsrv32
If the dll is in the same directory as the exe, you can use app.path to
determine where it is: shell "regsvr32.exe " & app.Path & "/dllname.dll"

You could have a button in the app to unregister it and then just shell
"regsvr32.exe " & app.path & "dllname.dll -u"

You should probably be careful registering dll's on a network share, but I
have seen it done. I don't know what performance hits you'll take because
of it. But if the shared folder is ever unavailable, the user won't be
able
to use the app, of course if the EXE is there too then this is a given.
And
also, if the Share disappears altogether, you will have orphaned registry
entries.






"Thomas Malia" <tommalia@xxxxxxxxxxxxxxxx> wrote in message
news:ODvSTvUSHHA.4028@xxxxxxxxxxxxxxxxxxxxxxx
This might be an option... how do I go about having the program do the
registration itself? Would I use the Scripting library to basically run
regsrv32.exe right at the begining of my program? How do I test, from
within my program, whether or not the DLL is already registered or not?




If I do this, how can I make it easy for the user to "un-register" the DLL
at some point if they want to? I would be fine with supplying a seperate
little program with the distribution of the main program that performs
this
function if you think that would be a viable option.

Regarding the environment, these programs will be "add-ons" to an
accounting
package. The way the accounting package works is, all the EXE's for the
package are installed to a shared directory on a server. Then each work
station that will be accounting the accounting system runs a "Workstation
Setup" process that installs a few DLL's and OCX's to the client's local
machine and links the icons for the actual accounting package to the
shared
install of the EXE's. So, in this environment, I think my end users would
not have a problem with an Add-on to the accounting system that required a
similar arrangement where a DLL needed for the Add-on needs to be
registered
on their local machine... However, I don't want the requirement to
register
the DLL to actually result in any extra "work" for a user who might try to
launch my application from the accounting system.

This brings me to another question actually.... I'd prefer to leave the
DLL
itself on the same shared directory as the EXE... will this present any
problems for client workstations? Are there any restrictions that will
prevent the client machines from registering and using a DLL that doesn't
reside on the actual local machine but rather is being accessed from the
shared server folder?

Thanks again!
Tom Malia

"Lance Wynn" <LanceWynn@xxxxxxxxxxxxxxxx> wrote in message
news:uv23gcUSHHA.4188@xxxxxxxxxxxxxxxxxxxxxxx
I believe ActiveX DLL's need to be registered.
Why don't you just have your .EXE file register the as needed.

If this is an internal or corporate application where you have a good
deal
of trust with the users, this would be fine I think. Otherwise, it might
look a bit like malware/spyware.

I certainly wouldn't use an application that didn't have an
install/uninstall with it.



"Thomas Malia" <tommalia@xxxxxxxxxxxxxxxx> wrote in message
news:%23pEKySUSHHA.2124@xxxxxxxxxxxxxxxxxxxxxxx
Hey folks,



I've written a custom DLL that I'm using within several new EXE's. For
distribution of these programs, I'd really rather NOT require any setup
process to need to be run for each workstation that the program might be
run
from. I'd rather be able to install the EXE and the DLL to a shared
directory on a server and then just let people directly launch the
program
from the share without having to run any setup processes.



I had thought that actually registration of a DLL was only necessary if
the
DLL could not be found in the directory where the program was running
from.
However, so far I have not been able to get my applications to run
without
explicitly registering the DLL (using Regsrv32.exe).



Is this an absolute requirement? Isn't there some way to create a
reference
to a DLL in an EXE that will first try to find the necessary DLL in the
search path of the application and IF it doesn't find it there, then look
in
the registry? I'm sure this is my naiveté about using DLL that's the
problem here. there most be something that can be done that I'm just not
familiar with.



Thanks in advance for any help,

Tom Malia









.


Loading