Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetObjectForNativeVariant throw InvalidCast ' Unable to case int to Intptr' . #5551

Closed
tijoytom-zz opened this issue Apr 8, 2016 · 0 comments

Comments

@tijoytom-zz
Copy link
Contributor

GetObjectForNativeVariant throw InvalidCast ' Unable to case int to Intptr' on windows

Variant v = new Variant();
IntPtr pObj = Marshal.GetIUnknownForObject(new object());
IntPtr pNative = Marshal.AllocHGlobal(Marshal.SizeOf(v));
Marshal.GetNativeVariantForObject(pObj, pNative);
IntPtr pActualObj = Marshal.GetObjectForNativeVariant(pNative);

@yizhang82 yizhang82 self-assigned this Apr 8, 2016
yizhang82 referenced this issue in dotnet/coreclr Apr 10, 2016
Fix GetObjectForNativeVariant test issue. It should roundtrip the actual object instead of IntPtr. Also add proper variant clean up code.

Fix #4192.
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 30, 2020
@msftgits msftgits added this to the 1.0.0-rtm milestone Jan 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants