I've been given a C++ class library project which I need to use from my
asp.net vb.net project. I have tried building the C++ class library it but it
only creates a series of .obj files which I can't reference from the asp.net
project. How do I get the C++ class library to compile to a dll (I've played
around with the properties of the project but it still doesn't seem to
produce a dll), is there any other way to include it in my asp.net project??

Re: Compiling C++ class project to a dll by Lionel

Lionel
Fri Jan 28 02:57:50 CST 2005


To learn more about C++ compiler's option, post your question in the C++
newsgroup.
But if you're not familiar with C++ compiler's option, the easy way to solve
your problem is:
- make an .NET C++ assembly,
- link your assembly with your C++ class library,
- map all methods from your C++ class library in a managed C++ class,
- call your new assembly from your VB.NET project.

For more information see:
http://www.15seconds.com/issue/030729.htm

I hope it helps.

Lionel.



"jwk" <jwk@discussions.microsoft.com> a écrit dans le message de news:
4548A7E4-F2CA-4A97-8B65-66F50670B112@microsoft.com...
> I've been given a C++ class library project which I need to use from my
> asp.net vb.net project. I have tried building the C++ class library it but
> it
> only creates a series of .obj files which I can't reference from the
> asp.net
> project. How do I get the C++ class library to compile to a dll (I've
> played
> around with the properties of the project but it still doesn't seem to
> produce a dll), is there any other way to include it in my asp.net
> project??
>



Re: Compiling C++ class project to a dll by Richard

Richard
Mon Jan 31 12:49:12 CST 2005


"jwk" <jwk@discussions.microsoft.com> wrote in message
news:4548A7E4-F2CA-4A97-8B65-66F50670B112@microsoft.com...
> I've been given a C++ class library project which I need to use from my
> asp.net vb.net project. I have tried building the C++ class library it but
> it
> only creates a series of .obj files which I can't reference from the
> asp.net
> project. How do I get the C++ class library to compile to a dll (I've
> played
> around with the properties of the project but it still doesn't seem to
> produce a dll), is there any other way to include it in my asp.net
> project??

You need to link them together as a library assembly. From the command line
(for one.obj and two.obj):

link /dll one.obj two.obj

With VS2003 this will give you a warning LNK4243, which in most cases is
harmless, but to compile the DLL properly you will need to create some extra
code as explained here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmex/html/vcconconvertingmanagedextensionsforcprojectsfrompureintermediatelanguagetomixedmode.asp

(this has got to be the web page with the longest name!)

Richard
--
My email address evpuneqt@zicf.bet is encrypted with ROT13 (see
www.rot13.com)