The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: lonewolff on March 01, 2009, 06:34:08 AM

Title: Cant find GetStockObject() [Solved]
Post by: lonewolff on March 01, 2009, 06:34:08 AM
Hi there!

I cant seem to be able to invoke GetStockObject().
MSDN says to use windows.h and Gdi32.lib

So I have put this at the start of the code

include \masm32\include\windows.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib

But I get an error of 'Undefined Symbol - GetStockObject'.

Any ideas on why this might be?

Thanks in advance
Title: Re: Cant find GetStockObject()
Post by: sinsi on March 01, 2009, 06:41:58 AM
You've answered your own question.

include \masm32\include\gdi32.inc
includelib \masm32\lib\gdi32.lib

Title: Re: Cant find GetStockObject()
Post by: lonewolff on March 01, 2009, 06:45:58 AM
Geez, I was sure I tried that.

Must be getting tired.  :bg

Thanks for your help sinsi
Title: Re: Cant find GetStockObject() [Solved]
Post by: lonewolff on March 01, 2009, 06:49:15 AM
Oh actually, I was misunderstanding things.

The inc files correspond to the lib files do they?

I was thinking in terms for C++ header files.
Title: Re: Cant find GetStockObject() [Solved]
Post by: MichaelW on March 01, 2009, 07:06:14 AM
The MASM32 .inc files perform a similar function to the C/C++ header files, except most of them contain only procedure prototypes, with the constants, structures, etc concentrated in windows.inc. As it is for C/C++, most of them are specific to a .lib file.