Re: Need help with Vector parameter when invoking C dll from C#



"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.

.



Relevant Pages

  • Re: Help with a Remote Type / Iterator
    ... we'd rather declare all of the types in the spec and ... We've tried a passive iterator, but some of the stuff we ... > package must be a remote subprogram. ... particular partition, then do the next partition, iterate over all ...
    (comp.lang.ada)
  • Re: CL and iterators - a newbie question
    ... If you compile your code with (DECLARE (OPTIMIZE SPEED)), ... returned from a non-local function, ... Moving from non-descriptor to descriptor requires ... If you create iterator and iterate in the same function, ...
    (comp.lang.lisp)
  • CL and iterators - a newbie question
    ... (declare (type (simple-array double-float) ... (declare (type fixnum next-position) ... I tried to profile it a bit using the following code: ... so it seems the iterator conses 16 bytes per call (2 double ...
    (comp.lang.lisp)
  • Re: trying to declare an iterator for a std::vector of template pointers
    ... > int main ... > Can anyone tell me if/how to declare an iterator to a vector of template ...
    (comp.lang.cpp)