Re: Need help with Vector parameter when invoking C dll from C#
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Wed, 13 Jun 2007 22:39:38 +0200
"Pucca" <Pucca@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:42DED808-4BE8-4E06-94E5-EA8297734083@xxxxxxxxxxxxxxxx
Hi Willy,
You're correct about this will not compile in C# correctly. I need help in
figuring out how to use and call this C++ function properly with the correct
paramenter type. The C++ function is
extern "C" DE_ERRORS __declspec(dllexport)EncodeAsnUser(Blob** ppBlob,
vector <CUserContextData>::iterator userDataIter)
I have the structure CUserContextData declare correctly in C# already. But
how do I use C# code to call this fucntion? I think the Blob** is declared
correctly but how do I declare a vector::iterator for the structure
CUserContextData as a parameter in C# to call this function? Thank you.
--
You can't call this function from C#, you can only pass an iterator from C++. What you could do is implement a function in a C++ wrapper that takes an array of type CUserContextData and convert this into a vector of type CUserContextData, then you need to declare a vector iterator for this vector and pass the iterator to the EncodeAsnUser function.
Willy.
.
- References:
- Need help with Vector parameter when invoking C dll from C#
- From: Pucca
- Re: Need help with Vector parameter when invoking C dll from C#
- From: Willy Denoyette [MVP]
- Re: Need help with Vector parameter when invoking C dll from C#
- From: Pucca
- Need help with Vector parameter when invoking C dll from C#
- Prev by Date: Re: timespan issue
- Next by Date: Re: Filling a Listbox on a User Control
- Previous by thread: Re: Need help with Vector parameter when invoking C dll from C#
- Next by thread: Udp server receives too much data
- Index(es):
Relevant Pages
|