Re: Can you fix this program? : C++ Dynamic Array Problems

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Carl Daniel wrote: The main criticism would be why write it at all? This
code is spelled std::vector<T> in C++. There's simply no need to write
code like this except for the learning exercise of it. A few other
criticisms inline below.

The reason I didn't use std:vector is because I don't know how to marshal
the vector back to a Managed .NET client. I am dealing with an API which has
no managed equivilant "Extended MAPI 1.0". and I am calling this code from
Un-Managed clients and Managed clients. Of course I could loop through the
vector in Un-Managed code to build an Folder[] and return it to the clients,
but then this would be an additional loop. Is my thinking good here? Maybe
you have a better idea now that you know a little more what I am trying to
accomplish..

When doing C++/CLI Interop there are so many ways of doing things, it's head
spinning. My intention is to minimize marshalling data across the
Managed/Un-Managed zone. My idea is too pass a single string to the
unmanaged code, and then let the un-managed code build a collection and
return a pointer to the data. For a total of two Interops.

Thanks for taking the time to reply.
Russell Mangel
Las Vegas, NV


.



Relevant Pages

  • RE: Implementing asynchronous COM interfaces
    ... i am relatively new to dotnet com interop ... i have a c++ com server implementing ICallFactory.for macking non blocking async calls ... i know how to make non blocking async calls from c++ clients ...
    (microsoft.public.dotnet.framework.interop)
  • Re: registering .Net assemblie as COM object
    ... create an strong name with sn.exe and associate with the dll ... in developer PC: ... in clients PC: ... I was not setting it to "Register for COM interop", ...
    (microsoft.public.dotnet.languages.csharp)
  • ASP.NET Code access security
    ... unmanaged C code using COM Interop. ... Component works fine with Console and windows based ... clients but does not work with ASP.NET clients. ...
    (microsoft.public.dotnet.security)