I have been playing around with trying to PInvoke GDI+ from C#, I made recently made the transition from C/C++ to C# and I really like the language, however being the old fashioned programmer I am I don't like the idea of the framework slowing down my applications with uncessesary safety checks. So I decided to try and PInvoke into GDI+ directly so tweak some extra performance out of an application I am writing. But every time I try I get an access violation, no-one seems to be able to tell me why. Gdiplus is just a c++ .dll that exports the symbols needed to be accessible from the outside. You can PInvoke every other .dll in the whole of windows, so why not Gdiplus. Furthermore the framework uses PInvoke to access Gdiplus so it can be done! If anyone can help i'll be very grateful, i'm about ready to give up and go back to c++.
By the way, I can succesfully create Pen objects and Brushes etc, the problem lies in passing the HDC to the actual drawing functions, Has anyone done this successfully? Please help, i'm at my wits end with this!!! ;-)