Quantcast
Channel: Questions in topic: "dllimport"
Viewing all articles
Browse latest Browse all 160

How do I cast an IntPtr to another class?

$
0
0
I'm currently trying to edit an extern method to just call another static method directly. (this is Mono.Sqlite.Data's UnsafeNativeMethods class). I'm assuming there has to be some kind of cast or dereference done? I'm not very familiar with IntPtrs and was also hoping to get some insight into how they work. I assumed that since these were both CSharp methods and not C/C++ there shouldn't be too big a problem? Thanks! Specifically, I want the extern function: [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] internal static extern void sqlite3_result_blob(IntPtr pCtx, byte[] value, int n, IntPtr pvReserved); to call the method: sqlite3_result_blob(Community.CsharpSqlite.Sqlite3.sqlite3_context pCtx, string value, int n, Community.CsharpSqlite.Sqlite3.dxDel pvReserved); But I can't figure out how to cast the IntPtr to Sqlite3.sqlite3_context. Or vice versa. Any help would be appreciated!

Viewing all articles
Browse latest Browse all 160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>