Re: Getting OS bitness
Drew <dam@dam.com> wrote:
Sorry, one more question. Let me explain what I'm trying to do. The
format of our files changed in an earlier version of our software and
we store the version of our software in our files. When we detect
that is older than a specific version we ask the user if they would
like to translate the file to be compatible with our newest version.
What happens is we use a COM DLL produced at the time of the format
change that just reads the file in and writes it back out to be
compatible. The DLL that does the conversion will always be 32-bit.
Currently, we only produce a 32-bit version our product (which
includes the same DLL) but we are moving toward producing both 32 and
64-bit versions of the program (and DLL). The way I have implemented
it is that I unregister our newest DLL using regsvr32.exe then
register the old version and do the read/write and then unregister
the old DLL and reregister the new DLL.
Under no circumstances will you be able to load a 32-bit DLL into a =
64-bit process. You'll have to design around this fundamental fact.
I get the path to regsvr32.exe
You don't need regsvr32.exe. Just load the DLL with LoadLibrary, do =
GetProcAddress on a function named DllRegisterServer, and call that.
In fact, you don't even need to have the DLL registered. Just load it =
with CoLoadLibrary, do GetProcAddress on a functon named =
DllGetClassObject, call that to obtain IClassFactory pointer, and =
finally call CreateInstance. This is roughly what CoCreateInstance is =
doing.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not =
necessarily a good idea. It is hard to be sure where they are going to =
land, and it could be dangerous sitting under them as they fly overhead. =
-- RFC 1925