Reputation: 37
I have a function in C++ that returns pointer values:
fPosFirst( int &aId, char *aNname, char *aDirectory );
But I have to pass this to C#. How can I do that?
Upvotes: 1
Views: 201
Reputation: 43188
This is VB.NET syntax, but you should be able to convert this to C# easily enough.
Private Declare Ansi Sub fPosFirst lib "libraryname" (ByRef aId as Integer, byval aName as StringBuilder, byval aDirectory as StringBuilder)
Now if aNname and aDirectory should have been const char *, you can use String instead of StringBuilder and it gets a lot easier.
Upvotes: 1