Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!hplabs!hp-pcd!hpcvlx!bturner From: bturner@hpcvlx.HP.COM (Bill Turner) Newsgroups: comp.windows.ms Subject: Re: SDK Questions Message-ID: <106580006@hpcvlx.HP.COM> Date: 30 Nov 88 18:02:54 GMT References: <350@thebeach.UUCP> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 39 I have answers to some of the questions, so... > Also, has anyone ever used the EnumProps() function? If so, Can you explain > the correct form for the enumeration function that is passed as an argument? I haven't used EnumProps, but from past experience with other enumeration functions, I would assume that it would be BOOL FAR PASCAL YourEnumProcName(hWnd, lpString, hData); and that you would call EnumProps with lpProc = MakeProcInstance(YourEnumProcName, hInst); EnumProps(hWnd, lpProc); FreeProcInstance(lpProc); Again, I haven't done this, but it is consistent with other enumeration functions. > Do all FARPROCs created with MakeProcInstance() need to be freed before > the end of the program with FreeProcInstance()? Yes, otherwise there is a memory dribble (see below). > What will happen if GDI objects like brushes are created but not freed > before a program terminates? Will this seriously screw things up, or > will it just make a small amount of memory permanently unavailable to > Windows? Nothing major, just memory leaks. (below) There are some times in Windows when objects allocated are automagically discarded on app exit. The ones that aren't are the GDI drawing objects (pen, brush, font [VERY large], bitmaps) and code thunks (allocated by MakeProcInstance). The reason they aren't freed automatically is that they are allocated to belong to the Windows library, rather than to your app. --Bill Turner