A better way is to create .NET wrappers (as I mentioned earlier). You create a .NET class library using C++/CLI.
And call your unmanaged DLL within your C++ code (as normal) This way you can add in an additional layer to make the calls more .NET friendly. -----Original Message----- From: Kevin Palmer Sent: 16 November 2007 16:53 To: 'Discussion of advanced .NET topics.' Subject: RE: [ADVANCED-DOTNET] calling c++ dll from C#.... http://www.adp-gmbh.ch/csharp/call_dll.html -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Nicholls, Mark Sent: 16 November 2007 16:46 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] calling c++ dll from C#.... It's just a bog standard windows dll...as far as I know. Do you know of any reasonable reference to do it? -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Palmer Sent: 16 November 2007 16:41 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] calling c++ dll from C#.... If your DLL is a COM DLL you could consider using interop. Also you can write a C++/CLI component which allows access to managed & unmanaged code, create a managed (ref) class and call unmanaged code from it. -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Mark Nicholls Sent: 16 November 2007 16:25 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: [ADVANCED-DOTNET] calling c++ dll from C#.... Hello, can someone give me some advice about calling a unmanaged C++ dll from C#.....it also uses templates from the STL......it all sounds a bit horrible....any advice....or (good) articles on the web somewhere. =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com