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
Solved

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

Posted on 2016-09-12
2
22 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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