Sign in to follow this  

managed unmanaged method invoking

This topic is 3491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been working on a plugin for a mapeditor. This plugin is written in managed c++. I'm using pixie as a raytracer to do some calculation i'm gonna use to build lightmaps. But I've problems invoking pixies render interface methods from my managed plugin. I get the error message: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." When i call the methods from an unmanaged c++ project everything seems to be fine. Calling a method from my own dll in the same way also does work! In the managed plugin my .h: using namespace System::Runtime::InteropServices; [DllImport("ri.dll", EntryPoint = "grom")] extern "C" void grom(); .cpp: just a grom(); method call... ri.h: #define EXTERN(type) extern __declspec(dllexport) type EXTERN(RtVoid) grom(); in ri.cpp: EXTERN(RtVoid) grom() { RtColor blue= {0.2f, 0.3f , 0.9f}; RtPoint Square[4]={{.5,.5,.5},{.5,-.5,.5},{-.5,-.5,.5},{-.5,.5,.5}}; RiBegin(RI_NULL); RiDisplay( "", "framebuffer", "rgba"); RiFormat (640, 480, 1); RiFrameAspectRatio (4.0f/3.0f); RiWorldBegin(); RiColor(blue); RiPolygon(4, RI_P, (RtPointer)Square, RI_NULL); RiWorldEnd(); RiEnd(); } i hope someone can help me, thanks, naas

Share this post


Link to post
Share on other sites

This topic is 3491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this