|
-
August 12th, 2010, 12:20 AM
#2
Re: Pinning an array
I see here two strange points, though I am not sure that this is the reason on the failure:
1) array<IntPtr>^%
% is not necessary in this case, since you don't change the reference in this function.
2) array<IntPtr> in mapped to the HANDLE array. Are you sure that IntPtr structure has the same size as HANDLE? Possibly it is, but this is dangerous. pin_ptr should be applied only to simple types like integer.
If performance is not critical, create int array (long for x64), copy every IntPtr to it in the managed code, and then call DIB_LoadArrayFromFilename with pinned int array.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|