Jump to content
  • Advertisement
Sign in to follow this  
naas

managed unmanaged method invoking

This topic is 3703 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!