I'm a C++ dev writing a series of ActiveX controls for unifying our access to our product's DB...

  • Thread starter Thread starter WTH
  • Start date Start date
W

WTH

....and I'd like to write it in such a way that I do not prevent us from
using C# in the near future (as I think the language is great.)

The caveats are that it must be written in unmanaged C++.

Now, if C# were not an issue (or any CLR based language), I would simply
create a regular ATL COM server (in process) and offer a few interfaces
which would pass back dynamically allocated structures containing the
results data; however, if I'm not mistaken, although the interfaces are
easily used from C#, the structures to be returned would not be as they are
defined as C++ classes.

Is there some mechanism for passing structures between unmanaged C++ and C#?
How is structured data retrieved by a C# client from a C++ dll? Is this
just a 'no go'?

Thanks for the insights to come,

WTH
 
Probably is possible (although I personally don't know how), but if you
think the C# developers might not know, then you could write methods that
are exported from the umc++ that just return either arrays or strings -
could the data not be shoehorned into an array of numbers, or strings?
 
Bonj said:
Probably is possible (although I personally don't know how), but if you
think the C# developers might not know, then you could write methods that
are exported from the umc++ that just return either arrays or strings -
could the data not be shoehorned into an array of numbers, or strings?

Yeah, I was thinking XML possibly, or string arrays with some utility
classes on either client side to 'decode' them.

Thanks.

WTH
 
Back
Top