News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

BitmapFromFile link error

Started by vega, March 19, 2008, 07:14:58 AM

Previous topic - Next topic

vega

Hi all,
I don't understand the cause of these link errors.
(I do using MASM32 ver.9, now)

MASM32.LIB<bitmapfromfile.obj> : error LNK2001: unresolved external symbol _CoTaskMemAlloc@4
MASM32.LIB<bitmapfromfile.obj> : error LNK2001: unresolved external symbol _CoTaskMemFree@4
MASM32.LIB<bitmapfromfile.obj> : error LNK2001: unresolved external symbol _OleLoadPicturePath@24



<Ref. code block in my application>

      Invoke  BitmapFromFile, ADDR ImageFileNameBuffer
      Mov      hImage, EAX
           
      Invoke  CreateWindowEx, WS_EX_CLIENTEDGE, ADDR registeredClassName, NULL,
                                     SS_BITMAP+WS_CHILD+WS_VISIBLE,
                                     10, 50, 350, 350, hWindow, NULL,
                                     hInstance, NULL
      Mov      hStaticWindow, EAX
           
      Invoke  SendMessage, hStaticWindow, STM_SETIMAGE, IMAGE_BITMAP, hImage





Draakie

Hmmm that's strange.....

You do have the  oleaut32.inc and lib included right ? [EDIT LATER : This is probably the cause then]

and then the '#define' in the .RC file ? [EDIT LATER : OOOPS - U're loading from file..... erm sorry]

something like ...
#define    BMP_COINS   301 
#define   BMP_ACCNT   302 

BMP_COINS   BITMAP   DISCARDABLE   COINS.BMP
BMP_ACCNT   BITMAP   DISCARDABLE   ACCNT.BMP

see http://www.masm32.com/board/index.php?topic=5880.0 - for a working example if you're still having issues.

[EDIT LATER: Example...]
BITMAP FROM FILE EXAMPLE :
http://www.masm32.com/board/index.php?topic=937.0
Does this code make me look bloated ? (wink)

vega

Thanks, Draakie

That's right, your point out.
< You do have the  oleaut32.inc and lib included right ? [EDIT LATER : This is probably the cause then] >

I added ole32.inc, oleaut32.inc and ole32.lib, oleaut32.lib

but, occured assembly error in this time.

\MASM32\LIB\ole32.lib<1> : error A2008: syntax error : !
\MASM32\LIB\ole32.lib<2> : error A2044: invalid character in file
\MASM32\LIB\ole32.lib<3> : error A2044: invalid character in file
\MASM32\LIB\ole32.lib<4> : error A2044: invalid character in file
\MASM32\LIB\ole32.lib<5> : error A2044: invalid character in file
    ;
\MASM32\LIB\ole32.lib<101> : error A2044: invalid character in file
    ;
error counter exceed 100; stopping assembling   
assembly error..




Tedd

Use "includelib" for '.lib' files, and "include" for '.inc' :wink
No snowflake in an avalanche feels responsible.

vega

Ah~
I'm very stupid..  :red
thank you, Tedd