开发者

c# wrapper and issue with protected memory

So I've now progressed to having an almost functioning wrapper.

Other posts regarding my wrapper issues are:

C# wrapper and Callbacks &

C# wrapper for array of three pointers

I use the wrapper to establish a connection to the Dallmeier using the following:

_dallmeier.SessionHandle = DallmeierSDK.dlm_connect(_handle, _ip, "", _pass, null, null, connectionCallback, pInPut)  

This returns the session handler. After awhile I get a AccessVoilationException about attempted to read or write protected memory.

I think this has something to do with 开发者_开发问答using Marshal.Read and/or Marshal.Copy (as stated in one of the posts above) but I'm not sure where I use these commands.

Can some please advise me on this and/or examples?


maybe you could try wrapping your code in a fixed block, to prevent moving the pointer in memory or being GC-collected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜