Solved

How can i access a Visual C++ 2005 (.net ) Class Library DLL from within a Win32 console application?

Posted on 2008-10-01
2
285 Views
Last Modified: 2013-12-14
Hi:

I have a .net Class Library DLL that consumes a Web Service and i need to expose a method that can be called from an executable. I knew how to do this for another DLLS, where the DEF file or the IDL file shows the available methods but in this case i don't see neither of those files. I'm kind of new to this escenario.

Thanks,

Johann

Ps:
I'm trying to follow the instructions here:
http://forums.msdn.microsoft.com/en-US/vclanguage/thread/c46ee154-1465-4bd3-a642-beef4263d40c/
but can't make declspec work for managed code.
0
Comment
Question by:JohannRamon
2 Comments
 
LVL 2

Accepted Solution

by:
jvulliet earned 500 total points
ID: 22658732
Hello,

one possibility is to create a COM wrapper to your assembly (or just expose your assembly to COM if you have the source code).

Then it's fairly easy to do a call from unmanaged C++.

Example link:
http://havdone.blogspot.com/2007/12/steps-expose-assembly-to-com.html

or you can have your Win32 console application running in mixed mode, go to your project properties (General), the choose this option : Common Language Runtime Support (/clr)
You can now add a reference to the dll in your project.

Example link:
http://www.mastropaolo.com/2005/05/28/c-mixed-mode-applications/

0
 
LVL 2

Author Comment

by:JohannRamon
ID: 22661097
Thanks jvulliet!

I will try it!

Johann
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb. Net application freezes 9 45
start a process from a service 3 21
DataTables + iCheck + pagination Issue 2 15
VB.NET 2008 - SQL Timeout 9 22
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

816 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

8 Experts available now in Live!

Get 1:1 Help Now