Using a VB6 ActiveX exe in a WCF project

I have to use a VB 6 ActiveX component in a WCF project. I am using Visual Basic 2013. I have created a windows forms project, referenced the VB 6 component and everything works fine. This was done on my Development machine.
I have an existing WCF program that is working on my Development machine using the local IIS. I added a reference to the VB6 component to the WCF project but it fails when I try to Early Bind to the VB6 component.

The error occurs at:
DIM objWP as New WPProjectX.Class1

Why does this error in a WCF project but not a Window project? How to I use this VB 6 component in a WCF project?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
I cannot say for sure because I never had to do that, but a WCF project is a service, and usually services run in the background and cannot display anything. It might thus prevent you from referencing a .exe.

What error message do you get?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mpdillonAuthor Commented:
After closely examining the project after it was moved to the wwwroot of IIS, I discovered that the ActiveX  component was not there. I only get to work on this on Tuesdays so tomorrow I am going to first copy the ActiveX Dll that was created by Visual Studio to the Bin folder. If that does not work, I am going to add the Active X exe to that folder. If that does not work I am going to try late binding as I know this Active X exe is registered on this machine.

Jacques Bourgeois (James Burger)PresidentCommented:

Visual Studio does not create an ActiveX dll in the bin directory. It creates an interop, a .NET dll that acts as a bridge between the application and the ActiveX component. And that dll does not need to be registered in any way.

The dll that you need to install and register on the computer on which the application is running is the original VB6 ActiveX dll. If this is done properly, and if the interop is in the same directory as the application/service, things should work correctly.

And because you are working in 2013, you might want to do the following. In the References window select the reference to your ActiveX dll. Then, in the Properties windows, set the Embed Interop Types property to True. Instead of generated an interop dll, this will include in your own exe/dll all the features that are required to access the ActiveX dll, so you won't need the interop. The ActiveX dll will still need to be registered on the destination computer however.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.