473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

COM Interop error on 64 bit

I have a VB6 executable that references a .NET 2.0 dll.
The .NET 2.0 dll project has 'Register for COM Interop' checked. Thus,
compiling the dll will generate the .tlb file. This will allow early binding
to work from VB6.

I copied the VB6 exe and the .NET dll to a 32 bit OS. I copied the tlb file
to system32. When I execute the VB6 exe and call the .NET dll it works fine.

NOW, if I copy the VB6 exe and the .NET dll to a 64 bit OS and execute it, I
get the 'ActiveX cannot create object' error. I tried both, early and late
binding but I keep getting the same error.

If I call the .NET dll from another .NET app on a 64 OS, it works fine.

Is there anything different that I would have to do in order to get the VB6
application to call a .NET dll while running on a 64 bit OS?
--
ANeelima
Nov 13 '06 #1
6 6519

"ANeelima" <ne*****@newsgroups.nospamwrote in message
news:C9**********************************@microsof t.com...
|I have a VB6 executable that references a .NET 2.0 dll.
| The .NET 2.0 dll project has 'Register for COM Interop' checked. Thus,
| compiling the dll will generate the .tlb file. This will allow early
binding
| to work from VB6.
|
| I copied the VB6 exe and the .NET dll to a 32 bit OS. I copied the tlb
file
| to system32. When I execute the VB6 exe and call the .NET dll it works
fine.
|
| NOW, if I copy the VB6 exe and the .NET dll to a 64 bit OS and execute it,
I
| get the 'ActiveX cannot create object' error. I tried both, early and
late
| binding but I keep getting the same error.
|
| If I call the .NET dll from another .NET app on a 64 OS, it works fine.
|
| Is there anything different that I would have to do in order to get the
VB6
| application to call a .NET dll while running on a 64 bit OS?
| --
| ANeelima
1) The assembly is not registered on the target system, try running
regasm.exe /codebase /tlb <your.dllfrom an elevated administrative prompt,
or better create deployment project in VS for your solution.
2) You should never ever copy private dll's and tlb's to %windir%\System32,
they belong to your private application path.
Willy.
Nov 13 '06 #2
I ran regasm and created a .reg file for the .NET dll. I then
double-clicked this file on the 64 bit system. This added the required
registry entries.

But, I am still getting the error.
--
ANeelima
"Willy Denoyette [MVP]" wrote:
>
"ANeelima" <ne*****@newsgroups.nospamwrote in message
news:C9**********************************@microsof t.com...
|I have a VB6 executable that references a .NET 2.0 dll.
| The .NET 2.0 dll project has 'Register for COM Interop' checked. Thus,
| compiling the dll will generate the .tlb file. This will allow early
binding
| to work from VB6.
|
| I copied the VB6 exe and the .NET dll to a 32 bit OS. I copied the tlb
file
| to system32. When I execute the VB6 exe and call the .NET dll it works
fine.
|
| NOW, if I copy the VB6 exe and the .NET dll to a 64 bit OS and execute it,
I
| get the 'ActiveX cannot create object' error. I tried both, early and
late
| binding but I keep getting the same error.
|
| If I call the .NET dll from another .NET app on a 64 OS, it works fine.
|
| Is there anything different that I would have to do in order to get the
VB6
| application to call a .NET dll while running on a 64 bit OS?
| --
| ANeelima
1) The assembly is not registered on the target system, try running
regasm.exe /codebase /tlb <your.dllfrom an elevated administrative prompt,
or better create deployment project in VS for your solution.
2) You should never ever copy private dll's and tlb's to %windir%\System32,
they belong to your private application path.
Willy.
Nov 13 '06 #3
You have to make sure, this dll is registered in the virtualized registry
(the 32bit one). 32 bit COM clients won't get a chance to create such COM
servers when registered in the 64bit registry.
The only way I see you can make sure it's done correctly is by running
regasm.exe (the 32 bit version) on the target system, or by means of a
set-up program, like mentioned in my previous answer.

Willy.

"ANeelima" <ne*****@newsgroups.nospamwrote in message
news:46**********************************@microsof t.com...
|I ran regasm and created a .reg file for the .NET dll. I then
| double-clicked this file on the 64 bit system. This added the required
| registry entries.
|
| But, I am still getting the error.
| --
| ANeelima
|
|
| "Willy Denoyette [MVP]" wrote:
|
| >
| "ANeelima" <ne*****@newsgroups.nospamwrote in message
| news:C9**********************************@microsof t.com...
| |I have a VB6 executable that references a .NET 2.0 dll.
| | The .NET 2.0 dll project has 'Register for COM Interop' checked.
Thus,
| | compiling the dll will generate the .tlb file. This will allow early
| binding
| | to work from VB6.
| |
| | I copied the VB6 exe and the .NET dll to a 32 bit OS. I copied the
tlb
| file
| | to system32. When I execute the VB6 exe and call the .NET dll it works
| fine.
| |
| | NOW, if I copy the VB6 exe and the .NET dll to a 64 bit OS and execute
it,
| I
| | get the 'ActiveX cannot create object' error. I tried both, early and
| late
| | binding but I keep getting the same error.
| |
| | If I call the .NET dll from another .NET app on a 64 OS, it works
fine.
| |
| | Is there anything different that I would have to do in order to get
the
| VB6
| | application to call a .NET dll while running on a 64 bit OS?
| | --
| | ANeelima
| >
| >
| 1) The assembly is not registered on the target system, try running
| regasm.exe /codebase /tlb <your.dllfrom an elevated administrative
prompt,
| or better create deployment project in VS for your solution.
| 2) You should never ever copy private dll's and tlb's to
%windir%\System32,
| they belong to your private application path.
| >
| >
| Willy.
| >
| >
| >
Nov 13 '06 #4
I opened the system registry in the 64 bit OS and found the .NET dll under
WOW6432Node. So, I am assuming that it did get registered in the 32 bit
virtualized registry. Is that correct?

--
ANeelima
"Willy Denoyette [MVP]" wrote:
You have to make sure, this dll is registered in the virtualized registry
(the 32bit one). 32 bit COM clients won't get a chance to create such COM
servers when registered in the 64bit registry.
The only way I see you can make sure it's done correctly is by running
regasm.exe (the 32 bit version) on the target system, or by means of a
set-up program, like mentioned in my previous answer.

Willy.

"ANeelima" <ne*****@newsgroups.nospamwrote in message
news:46**********************************@microsof t.com...
|I ran regasm and created a .reg file for the .NET dll. I then
| double-clicked this file on the 64 bit system. This added the required
| registry entries.
|
| But, I am still getting the error.
| --
| ANeelima
|
|
| "Willy Denoyette [MVP]" wrote:
|
| >
| "ANeelima" <ne*****@newsgroups.nospamwrote in message
| news:C9**********************************@microsof t.com...
| |I have a VB6 executable that references a .NET 2.0 dll.
| | The .NET 2.0 dll project has 'Register for COM Interop' checked.
Thus,
| | compiling the dll will generate the .tlb file. This will allow early
| binding
| | to work from VB6.
| |
| | I copied the VB6 exe and the .NET dll to a 32 bit OS. I copied the
tlb
| file
| | to system32. When I execute the VB6 exe and call the .NET dll it works
| fine.
| |
| | NOW, if I copy the VB6 exe and the .NET dll to a 64 bit OS and execute
it,
| I
| | get the 'ActiveX cannot create object' error. I tried both, early and
| late
| | binding but I keep getting the same error.
| |
| | If I call the .NET dll from another .NET app on a 64 OS, it works
fine.
| |
| | Is there anything different that I would have to do in order to get
the
| VB6
| | application to call a .NET dll while running on a 64 bit OS?
| | --
| | ANeelima
| >
| >
| 1) The assembly is not registered on the target system, try running
| regasm.exe /codebase /tlb <your.dllfrom an elevated administrative
prompt,
| or better create deployment project in VS for your solution.
| 2) You should never ever copy private dll's and tlb's to
%windir%\System32,
| they belong to your private application path.
| >
| >
| Willy.
| >
| >
| >
Nov 13 '06 #5
"ANeelima" <ne*****@newsgroups.nospamwrote in message
news:AD**********************************@microsof t.com...
>I opened the system registry in the 64 bit OS and found the .NET dll under
WOW6432Node. So, I am assuming that it did get registered in the 32 bit
virtualized registry. Is that correct?
Don't know what WOW6432Node is all about, but I guess you mean that your dll is in the
SysWOW64 folder, right? Well, once again, put your stuff in a private folder, but stay out
of the system folders. Anyway, that doesn't mean your DLL is registered, you just copied the
dll in SysWOW64.
What you should do is:
1. Create a private folder and copy your dll and VB client into this folder.
2. Run a command prompt as administrator.
3. Run "regasm.exe /codebase /tlb <yourcomserver>.dll" from the 32 bit Framework folder
(x:\Windows\Microsoft.NET\Framework), where x is your system drive. Take care NOT to run
regasm.exe from Framework64!, or your dll will get registered as 64 bit (in the
non-virtualized registry).
4. Run your VB6 client.

If you want to inspect wheter your COM server did get registered correctly, start regedit
from SysWow64 (the 32 bit version) and seach HKCR\clsid, it should be there, again don't
start regedit from Run..., this will start regedit.exe from System32.

Willy.
..

Nov 13 '06 #6

"ANeelima" <ne*****@newsgroups.nospamwrote in message
news:AD**********************************@microsof t.com...
|I opened the system registry in the 64 bit OS and found the .NET dll under
| WOW6432Node. So, I am assuming that it did get registered in the 32 bit
| virtualized registry. Is that correct?
|
| --

I see, where you got this WOW6432Node from, it's the redirected HKCR\CLSID
registry node for 32bit registered COM classes. This is indeed an indication
the assembly is registered as 32 bit, but more importantly is the assembly
path, this path is correctly written when applying the /codebase option when
registering, without this option, requires the client and server (COM dll)
to reside in the same folder.

Willy.
Nov 14 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: roy | last post by:
I try to call com written in VB 6.0. When I use VS.net Studio to do the debuging, some time it works fine, some time I got the following message: Server Error in '/GISOnlineReservation'...
0
by: roy | last post by:
I try to call com written in VB 6.0., some time it works fine, some time I got the following message: Server Error in '/GISOnlineReservation' Application....
2
by: John Dalberg | last post by:
I have an application that's giving an error during installation. "Error 1935. An error occured during the installation of assembly interop.sqldmo, version 8.0.0.0, PublicKeyToken........" I am...
20
by: Razzie | last post by:
Hey all, I'm really going through a small hell right now - I've completely lost it :) I made a project, using two interop libraries from exchange (created them as in this msdn article:...
4
by: Robert | last post by:
I have created a .dll in C# which has a reference to Excel. When I add a strong name to the .dll in the AssemblyInfo.cs and try to rebuild, I get the following error: Assembly generation failed...
8
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be...
7
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed...
0
by: R Reyes | last post by:
ISSUE (reposted) =========================== Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? For many people, they say they add the...
2
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a...
0
by: Tina | last post by:
I've gotten this before where it says there is a problem with Interop.MSDASC but I can't remember what causes this. This is a 1.1 app I'm trying to debug in vs2005. It was running yesterday just...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.