Solved

VB6 call a .NET 3.5 dll

Posted on 2014-01-21
1
1,304 Views
Last Modified: 2014-01-24
I'm trying to call a .NET 3.5 C# dll from a VB 6 GUI. I added the .NET 3.5 dll as a reference to the VB6 Project. The .NET dll is compiled with COM Interop enabled. If I compile the .NET dll in Visual Studio I have no problem with the VB6 GUI using the .NET dll. However when I put the .NET csproj in a buld script that compiles all my .NET dlls with MSBUILD.EXE I get a "Runtime error '429': Active X component can't create object" when the VB6 GUI tries to access it. I'm not sure what's the difference in compiling the .NET dll within Visual Studio 2010 and using MSBUILD. Is Visual Studio 2010 more forgiving? I tried to manually register it using regsvr32 and regasm but no luck Could anyone point me in the right direction? I'm on Windows 7. Thanks.

David
0
Comment
Question by:davidst98
1 Comment
 
LVL 5

Accepted Solution

by:
advfinance earned 500 total points
Comment Utility
For your VB6 application to be able to locate the .NET DLL it must either be installed into the Global Assembly Cache, placed into the VB6 application directory (either the IDE's directory or your application's directory - depending upon whether you are running your program from the VB6 IDE or from a compiled EXE) or the .NET DLL must have been registered for COM interop using the /codebase option of regasm. I believe if using the "register for COM interop" option in the C# project file it will register the assembly using the /codebase option.

--
Chris
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now