CFile in CE and C#

  • Thread starter Thread starter wanderer
  • Start date Start date
W

wanderer

If I have a DLL that requires a pointer to a CFile type
as a parameter, is there a way I can create a CFile handle
and initialize it in C# so I can use my DLL function?
Thanks.
 
wanderer,

The only way I know of would be to create a C++ wrapper app that uses CFile
internally and exposes the handle via PInvoke to your C# app. Depending on what
your DLL does, it might not be worth the trouble.
 
By CFile do you mean the MFC class? then No - no only are you mixing your
languages
but you are also trying to mix your frameworks. The dll probably only
exports mangled names
as well.

Best bet would be to use a native dll to wrap your calls to this dll to and
give your native function
the path name to it.

If you have the code you might be able to just rewrite it in C#/VB.NET

Shaun
 
Back
Top