Hi All,
I have a C# DLL which was written for me to interface with my VB6 program. The DLL is COM-Visible and the Register for COM interop selected. The DLL has 3 methods Initialization, Up and Dn.
I have a small VB6 test program which access the DLL.
I'm using VS 2017 (run as administrator) to build the DLL
I have Visual Studio (VB6) on the same machine - A Windows 10 PRO system.
In my VB program I have a reference to the DLL (actually the TLB). Intellesense works fine - I can see all three methods.
My startup code is:
Public Sub Main() Dim AM as AudioManager Set AM = New AudioManager ' <<<==== Error hereEnd Sub
When I run the program I get an error at the Set statement - Runtime 429 - "ActiveX component can't create object".
I've done quite a bit of research on the web about this, and most of the similar issues are when someone tries to move a project from a development environment. In my case , I'm getting this on the development system.
I have tried:
So far nothing seems to work. I have put the DLL and TLB into the System32, SYSWOW64 and my VB6 application folders (registering it in each after removing from the previous location) - doesn't help.
Anyone have any ideas?
Thanks in advance
.NET ProgrammingC#Visual Basic ClassicMicrosoft Visual Studio
Last Comment
Richard
8/22/2022 - Mon
AndyAinscow
A 32 bit component will not work with a 64 bit component. Check that both are the same bit size (probably 32 bit).
Richard
ASKER
Hi Andy,
Thanks for responding.
Not sure what you mean. The c# DLL was compiled with COM compatibility. To my way of thinking, that should have resolved any issue with bit size.
AndyAinscow
Check it. I think COM compatibility is something different from the bit size it is compiled with.
Hi Andy,
You were right. I found that the "Platform target" was set to "Any CPU". I changed it to x86, recompiled and it worked. it's funny how it's the little things that will get you!