Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!rpi!uupsi!rodan.acs.syr.edu!jfbruno From: jfbruno@rodan.acs.syr.edu (John Bruno) Newsgroups: comp.windows.ms Subject: Mistakes in SDK3.0 documentation? Message-ID: <1990Sep19.190320.25693@rodan.acs.syr.edu> Date: 19 Sep 90 19:03:20 GMT Sender: jfbruno@rodan.acs.syr.edu (John Bruno) Organization: Integrated Healthcare Technologies, Inc. Lines: 25 I believe I have found a minor error in the "Guide to Programming" book that is supplied with SDK 3.0. It's in the StringOut function on page 18-6. This function is supposed to write a string in the given font, then reset to the previous font and return the length of the string. The function first switches the font, then writes the text, then restores the original font, then calculates and returns the length. The length should be calculated before switching back to the original font, like so: WORD StringOut(hDC, etc) ... { HANDLE hPrevFont; WORD length; hPrevFont = SelectObject(hDC, hFont); TextOut(hDC, X, Y, lpString, lstrlen(lpString)); length=LOWORD(GetTextExtent(hDC, lpString, lstrlen(lpString))); SelectObject(hDC, hPrevFont); return(length); } Since I'm just learning about Win3, I'm wondering if anyone has noticed any other problems with the SDK. If so, please post. ---jb