473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

GDI+ PInvoke - Target language C#

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!!! ;-)
Dec 5 '07 #1
0 1179

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Philip Wagenaar | last post by:
I use a class to manage tiff's (written by someone else) to splitt multipage tiffs. However, when I run it, it fails, for other people it seems work ok. The method in the class is :public...
5
by: Bonj | last post by:
How can GDI+ be used from C++?? I tried the following methods, but all failed with about 100 different errors relating to stuff that was not in any file I created. The file <gdiplus.h> only exists...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
3
by: msnews.microsoft.com | last post by:
Hi i am using User32.dll in Visual stdio 2005. public static extern long SetActiveWindow(long hwnd); public static extern long keybd_event(byte bVk, byte bScan, long dwFlags,
8
by: Rajesh Soni | last post by:
Hi! I'm getting a PInvoke error while trying to execute the following code... declaration: Structure POINTAPI Dim x As IntPtr
0
by: oldguy | last post by:
A call to PInvoke function 'WindowsApplication1!WindowsApplication1.Module1::Sleep' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target...
14
by: Mohamed Mansour | last post by:
Hey there, this will be somewhat a long post, but any response is appreciated! I have done many PInvoke in the past from C++ to C#, but I did PInvoke within C# not C++/CLI. Can someone explain...
7
by: j4richard | last post by:
Help please, I am getting this "Unhandled Exception has occurred in your application" " A Generic error occurred in GDI+" See the end of this message for details on...
2
by: PJ6 | last post by:
I would like to see my application's graphics running full-screen (1920x1200), and GDI+ just doesn't cut it aesthetically since it's neither hardware accelerated, nor efficiently implemented. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.