Hi amirbehzadan!
> I am writing some C++ classes and want to export them as .dll files so
> other users can import them and use the methods I have provided in
[quoted text clipped - 3 lines]
> "unmanaged" classes. However I dont know how to export "managed"
> classes since this method doesnt work for them.
Just declare it as "public" and put it into a namespace. That´s it.
Any other managed programming language can simply reference the DLL and
use your class.

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/
amirbehzadan@hotmail.com - 26 May 2006 20:43 GMT
Hi Jochen,
Thanks a lot. That solved the problem of creating the DLL file. Now
when I am using the corresponding header and library file in a test
application to use that DLL file, I get a number of "unresolved tokens"
that most of them point to the functions inside the imported managed
class. Examples are :
Test error LNK2020: unresolved token (0600000B) TCM::.ctor
Test error LNK2020: unresolved token (0600000C) TCM::Finalize
Test error LNK2020: unresolved token (0600000E) TCM::Start
Test error LNK2020: unresolved token (0600000F) TCM::Stop
Test error LNK2020: unresolved token (06000010) TCM::BytesInRQ
Test error LNK2020: unresolved token (06000011) TCM::stdString
Test fatal error LNK1120: 6 unresolved externals
the last four functions are functions inside the imported managed class
TCM.
Thanks,
Amir
Jochen Kalmbach [MVP] - 27 May 2006 07:59 GMT
Hi amirbehzadan!
> Thanks a lot. That solved the problem of creating the DLL file. Now
> when I am using the corresponding header and library file in a test
> application to use that DLL file, I get a number of "unresolved tokens"
You *must not* use header and lib-files!!!
Just add (VC2003):
#using <MyManagedDll.dll>
Or in VS2005, add the reference to your project properties
(Common|References).

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/