How to use a COM dll on a WIndows 7 64 bit machine?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have built a DLL for changing the default printer to a new value and then setting it back to the original. This DLL will be called from a VBA addon to an ERP product. I think the version of the VBA is 6.3.
I have built a Visual Basic 2008 Dll using a COM component. This generates a DLL and TLB file. Using Regasm.exe from the .net frameworkv2.0.50727 folder to successfully register these components on Windows XP and Window 7 32 bit.
However, when I try to do this on a Windows 7 64 bit system, it fails. After some fiddling around, I was able to get a successful registration using the Regasm.exe in framework64v2.0.50727. But after the successful registration, the VBA project still cannot
use the DLL.
When I try to Reference the .tlb file in the VBA project, it is not visible even though the dialog filter is set to dll, tlb.

If I try to use late binding by using the getobject and/or createObject method, it fails.
There are two ways to answer this request.
1. How do I register my 32 bit COM dll on a Windows 7 64 bit machine?
2. How do I write a COM DLL component from scratch for a WIndows 7 64 bit machine using Visual Basic 2008 ( or 2010. I will upgrade if necessary)?
Thanks,<br/>
pat

View the full article
 
Back
Top