flat assembler
Message board for the users of flat assembler.

Index > Windows > Undefined symbol: 'get_Handle'

Author
Thread Post new topic Reply to topic
Meeky



Joined: 07 Jun 2009
Posts: 1
Meeky 08 Jun 2009, 03:55
I get an error "Undefined symbol: 'get_Handle'" with this snippet:
Code:
proc LoadImageFromMem uses esi edi, pImageAddr:DWORD, ImageLen:DWORD
local pPicture:DWORD
...
comcall [pPicture],get_Handle
    


Whereas IPicture is defined as struct:
Code:
struc IPicture
 {
    .handle                  dd  ?
   virtual at 0
    .QueryInterface          dd  ?
    .AddRef                  dd  ?
    .Release                 dd  ?
    .get_Handle              dd  ?
    .get_hPal                dd  ?
    .get_Type                dd  ?
    .get_Width               dd  ?
    .get_Height              dd  ?
    .Render                  dd  ?
    .set_hPal                dd  ?
    .get_CurDC               dd  ?
    .SelectPicture           dd  ?
    .get_KeepOriginalFormat  dd  ?
    .put_KeepOriginalFormat  dd  ?
    .PictureChanged          dd  ?
    .SaveAsFile              dd  ?
    .get_Attributes          dd  ?
   end virtual
 }
    

What can I do with it?
Also, where can I get definition of IStream and IUnknown interfaces, so I could do something like this?

mov eax,[pStream]
push eax
mov eax,[eax]
call [eax+IStream.IUnknown.Release]
Code:
    
Post 08 Jun 2009, 03:55
View user's profile Send private message Reply with quote
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix 08 Jun 2009, 11:18
Meeky, check "macro\com32.inc" file in fasm includes. There is "interface" macro in this file which you may use to declare interfaces and call their methods. Or you may use next addition after your IPicture struc:

Code:
virtual at 0
 IPicture IPicture
end virtual    


By the way, "comcall" macro requires the type of interface pointer, so it should be as follows:

Code:
comcall [pPicture],IPicture,get_Handle    


As for definitions of IStream and IUnknown - you may use both of ways to define them - via "interface" or in your own way.

If you wish to inherit IUnknown without repeating their methods - it requires additional macros. Maybe this link will be useful for you:

http://board.flatassembler.net/topic.php?t=9896


Regards.
Post 08 Jun 2009, 11:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.