Click here to Skip to main content
15,902,447 members
Home / Discussions / C#
   

C#

 
GeneralRe: 2 questions Pin
bouli12-Jul-04 4:44
bouli12-Jul-04 4:44 
GeneralRe: 2 questions Pin
Heath Stewart12-Jul-04 4:58
protectorHeath Stewart12-Jul-04 4:58 
GeneralRe: 2 questions Pin
bouli12-Jul-04 5:00
bouli12-Jul-04 5:00 
GeneralRe: 2 questions Pin
Nick Parker12-Jul-04 5:09
protectorNick Parker12-Jul-04 5:09 
GeneralRe: 2 questions Pin
bouli12-Jul-04 5:14
bouli12-Jul-04 5:14 
GeneralRe: 2 questions Pin
Heath Stewart12-Jul-04 5:13
protectorHeath Stewart12-Jul-04 5:13 
GeneralRe: 2 questions Pin
bouli12-Jul-04 5:16
bouli12-Jul-04 5:16 
GeneralRe: 2 questions Pin
Heath Stewart12-Jul-04 5:23
protectorHeath Stewart12-Jul-04 5:23 
So the exception is being thrown on the second line? How hard is that question to answer?

You need to debug your code and find out this type of information. Is the Message.HWnd or Message.WParam NULL (IntPtr.Zero) before being passed to GetDCEx?

I never said splitting the lines would make it work - that doesn't matter when the compiler produces the IL. I said it would make things easier to debug. Put a break-point in there and step through your code to see what the inputs and outputs of the methods are. And always perform checks (like making sure that GetDCEx doesn't return IntPtr.Zero before passing it to Graphics.FromHdc) - never assume something just works (especially when dealing with interop since the callee is unmanaged by the CLR).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: 2 questions Pin
bouli12-Jul-04 22:22
bouli12-Jul-04 22:22 
GeneralRe: 2 questions Pin
Heath Stewart13-Jul-04 3:01
protectorHeath Stewart13-Jul-04 3:01 
GeneralSNTP Client Pin
don7cry11-Jul-04 22:45
don7cry11-Jul-04 22:45 
GeneralRe: SNTP Client Pin
Dave Kreskowiak12-Jul-04 1:04
mveDave Kreskowiak12-Jul-04 1:04 
GeneralRe: SNTP Client Pin
Steven Campbell12-Jul-04 3:40
Steven Campbell12-Jul-04 3:40 
GeneralCall function from pointer Pin
joeyespo11-Jul-04 22:45
joeyespo11-Jul-04 22:45 
GeneralRe: Call function from pointer Pin
Mike Dimmick12-Jul-04 0:37
Mike Dimmick12-Jul-04 0:37 
GeneralRe: Call function from pointer Pin
Heath Stewart12-Jul-04 3:55
protectorHeath Stewart12-Jul-04 3:55 
GeneralRe: Call function from pointer Pin
joeyespo12-Jul-04 8:34
joeyespo12-Jul-04 8:34 
GeneralRe: Call function from pointer Pin
Heath Stewart12-Jul-04 9:11
protectorHeath Stewart12-Jul-04 9:11 
QuestionAbout error monitoring ? Pin
fu011-Jul-04 21:37
fu011-Jul-04 21:37 
AnswerRe: About error monitoring ? Pin
Colin Angus Mackay11-Jul-04 22:39
Colin Angus Mackay11-Jul-04 22:39 
AnswerRe: About error monitoring ? Pin
exhaulted12-Jul-04 2:57
exhaulted12-Jul-04 2:57 
GeneralRe: About error monitoring ? Pin
fu012-Jul-04 15:35
fu012-Jul-04 15:35 
GeneralRe: About error monitoring ? Pin
exhaulted12-Jul-04 21:48
exhaulted12-Jul-04 21:48 
GeneralRe: About error monitoring ? Pin
fu013-Jul-04 15:51
fu013-Jul-04 15:51 
GeneralRe: About error monitoring ? Pin
exhaulted13-Jul-04 22:43
exhaulted13-Jul-04 22:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.