Solved

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

Posted on 2016-09-12
2
26 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 63

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 63

Expert Comment

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

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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 …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

696 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