Thanks again. I got strings working to & from C#
Alas i have one more question.
It's a little hard to explain so bare with me.
The API i would like to wrap has a topography like this
Replay (the main class)
--Has instance of a Time class
--Has instance of a Action class
--Has instance of a Header
----Has instance of a Player class
or in C++ code something like this
class replay
{
...
replay_time m_time;
replay_actions m_actions;
header m_header;
};
I'd like to very much to mimic this topography for my managed proxy class so i created a managed proxys classes for those aswell that my managed (main class) Replay will have instances of (pheww say that ten times fast).
So it would look something like this
__gc class Header{public: Header (replay* arg) : m_replay(arg) {} ~Header () {} String* get_creator_name() { String __pin *str = new String(m_replay->m_Header.get_creator_name()); return str; }private:// this is a pointer to the main class in the native API// its initialized in the ctor// through this pointer it pretends to be the native header class// by just delagating all of replay.header functions replay* m_replay;};
Get it? The Header class takes a replay pointer and just delegates as if it were the native API right?
Ideally in C# code i could then use the API like, how its done in C++
Native.Replay rep = new Native.Replay();rep.open("somestring");rep.get_header().get_creation_date();
Anyway doing this compiles fine. But when it try and use it in C#, it crashes.
However if i ignore the proxy and write a function inside the the managed Replay class to access that function without trying to use the proxy it works.
i.e
Id rather not do this though. As that one class will have like 100 or so functions if i didn't split it up! And that would just be unwielding.
Any help would be extreamly appreciated
Thanks
"I turned into a driveway I thought was mine and crashed into a tree I don't have."- a real insurance claim