PC Review


Reply
Thread Tools Rate Thread

Calling C++ DLL

 
 
=?Utf-8?B?UGV0ZXIgU2NobWl0eg==?=
Guest
Posts: n/a
 
      2nd Mar 2005
Hi,

I need to call the followin function (that is placed in an additional DLL)
out of VB.NET code:

BOOL TestFunc(CString str1, CString str2)
{
[...]
}

How can I call this function out of VB.NET code? How do I declare the
parameters to match the ones in C++?

Thanks
Peter
 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      2nd Mar 2005

>How can I call this function out of VB.NET code?


You can't, not directly. You would have to wrap it with a function
that takes parameters of a string type that the CLR marshaler knows
about (char*, wchar_t* or BSTR), not CString.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling SQL from code has different behaviour than calling it from MS SQL Server Management Studio jeeji Microsoft C# .NET 1 29th Jun 2006 10:43 AM
Calling DoCmd.RunCommand acCmdSaveRecord, after calling an API function Savvoulidis Iordanis Microsoft Access Form Coding 2 19th Mar 2005 06:34 PM
Fail to send fax when making international fax calling / calling c =?Utf-8?B?c2Ftd2lzZQ==?= Windows XP Help 1 28th Dec 2004 02:31 PM
Calling FormsAuthentication.SignOut() after calling Response.Flush =?Utf-8?B?TWFydGluIExlZQ==?= Microsoft ASP .NET 1 28th Sep 2004 01:47 PM
Server Side button calling page_load before calling it's own click event. Ryan Ternier Microsoft ASP .NET 4 29th Jul 2004 02:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:12 PM.