Solved

Help referencing a 32-bit DLL in a 64-bit application

Posted on 2016-09-12
2
17 Views
Last Modified: 2016-10-01
Hello,

This is my first post on this forum. If I have not followed any standard etiquette or need to provide more information, please advise.

I have a Microsoft Project Add-In written in VB.NET (Visual Studio 2015) that I would like to make compatible with both the 32-bit and 64-bit environments of MS Project (2010+). The add-in would work in both, except we are referencing a custom, legacy DLL written in VB6 that is not compatible with the 64-bit Project environment.

We attempt to access this VB6 DLL's functionality by creating an object of it in the VB.NET code using the CreateObject() function. This results in 'Runtime Error (429): ActiveX can't create component' error in the 64-bit environment. It works fine for 32-bit.

Is there any way to create my object reference to this VB6 DLL without upgrading the legacy code to VB.NET?

Thank you for your time.
0
Comment
Question by:Christopher Baugh
  • 2
2 Comments
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points (awarded by participants)
ID: 41794517
To your statement, " I would like to make compatible with both the 32-bit and 64-bit environments of MS Project (2010+).", the best way to get this to work is to compile the .Net application for a 32 bit platform / x86. In this way it will run on both 32 bit and 64 bit, on a 64 bit system in will run in WOW64 which is part of the operating system. The next best option would be to rewrite the 32 bit dll to 64 bit. The last option would be a com object for the 32 bit dll and and modify the code in the .Net application to access the dll through IPC, Inter Process Communication, to access the dll functions. if you take this route please read this article Accessing 32-bit DLLs from 64-bit code.
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 41824632
I gave three possible solutions to the question.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

21 Experts available now in Live!

Get 1:1 Help Now