quat wrote:
Thanks, I got that error to go away, but now I get this error:
cannot convert parameter 6 from 'cli::interior_ptr<Type>' to
'IDirect3DDevice9 **'
[...]
As far as I know, this is just unmanaged code calling unmanaged code inside
a managed function. Does this not work?
Well, cli::interior_ptr is holding a pointer to a managed object. When
the garbage collector re-shuffles the memory, all interior_ptr's are
automatically updated, so they all point to the correct (possibly new)
location. In order to pass a pointer to an unmanaged function, you must
still pin it, to prevent the garbage collector from moving it around,
because unmanaged pointers can't be updated when the managed heap gets
defragmented.
If you're sure that all your types are unmanaged, you may try to move it
to an unmanaged function, and maybe use the #pragma unmanaged directive
to ensure that it's really compiled to native code. I'm not sure why the
compiler believes that your native types are somehow managed.
Tom