Path: utzoo!attcan!uunet!amdahl!ames!ucsd!orion.cf.uci.edu!uci-ics!venera.isi.edu!dick From: dick@venera.isi.edu (Richard Gillmann) Newsgroups: comp.windows.ms Subject: Re: A puzzling query Keywords: Windows, C Message-ID: <7737@venera.isi.edu> Date: 10 Mar 89 20:24:59 GMT References: <227@cbnewsc.ATT.COM> Reply-To: dick@venera.isi.edu.UUCP (Richard Gillmann) Organization: Information Sciences Institute, Univ. of So. California Lines: 19 In article <227@cbnewsc.ATT.COM> foz@cbnewsc.ATT.COM (The fozman) writes: >I am currently developing an application using SDK 2.1. Last night I ran >across an interesting bug(?). I had written a new function for it and compiled >it (MSC 5.1). While I was running my application, it hung somewhere in >the new function I had just inserted. Upon inspection of my code, I noticed >that I had written: > ReleaseDC(hDC, hWnd); >instead of: > ReleaseDC(hWnd, hDC); > >Now I think both HWND and HDC are 16 bit addresses but shouldn't the compiler >spit this out as a parameter order error? An enquiring mind would like >to know...... Welcome to C! The C language uses a form of weak typing, in which types are considered compatible if they have the same underlying base type (which is the case here). In strongly typed languages, such as Pascal or Ada, the type names must match, which in your example would lead to a compile time error.