flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > COM revisited |
Author |
|
mindcooler 31 Oct 2010, 13:44
Hah, and I was just thinking of how you could use inheritance with interfaces!
This made me think if there were some better solution: Code: IDirectSoundBuffer interface GetCaps,GetCurrentPosition,GetFormat,GetVolume,GetPan,GetFrequency,\ GetStatus,Initialize,Lock,Play,SetCurrentPosition,SetFormat,\ SetVolume,SetPan,SetFrequency,Stop,Unlock,Restore IDirectSoundBuffer8 interface GetCaps,GetCurrentPosition,GetFormat,GetVolume,GetPan,GetFrequency,\ GetStatus,Initialize,Lock,Play,SetCurrentPosition,SetFormat,\ SetVolume,SetPan,SetFrequency,Stop,Unlock,Restore,SetFX,\ AcquireResources,GetObjectInPath Code: struc interface [methods] { common label . virtual at 0 .#\.#QueryInterface rd 1 .#\.#AddRef rd 1 .#\.#Release rd 1 forward .#\.#methods rd 1 common end virtual rd 1 } _________________ This is a block of text that can be added to posts you make. |
|||
31 Oct 2010, 13:44 |
|
mindcooler 31 Oct 2010, 15:00
Code: Is it possible to do something like this? struct IUnknown label . .QueryInterface rd 1 .AddRef rd 1 .Release rd 1 ends struct IDirectSoundBuffer . IUnknown irp methods,GetCaps,GetCurrentPosition,GetFormat,GetVolume,GetPan,GetFrequency,\ GetStatus,Initialize,Lock,Play,SetCurrentPosition,SetFormat,\ SetVolume,SetPan,SetFrequency,Stop,Unlock,Restore { .#\.#methods rd 1 } ends struct IDirectSoundBuffer8 . IDirectSoundBuffer irp methods,SetFX,AcquireResources,GetObjectInPath { .#\.#methods rd 1 } ends ids8 IDirectSound8 idsb IDirectSoundBuffer idsb8 IDirectSoundBuffer8 _________________ This is a block of text that can be added to posts you make. |
|||
31 Oct 2010, 15:00 |
|
vid 31 Oct 2010, 15:11
mindcooler: why the second dot?
|
|||
31 Oct 2010, 15:11 |
|
mindcooler 31 Oct 2010, 15:12
Which second dot?
edit: You mean .#\.#methods rd 1 ? . for name, \. for "." name.method |
|||
31 Oct 2010, 15:12 |
|
baldr 31 Oct 2010, 16:50
mindcooler,
Inheritance can be done like this: Code: macro struct [args] { common local ! ! equ ? match derived:base, args \{ restore ! struct derived base \} match =?, ! \{ restore ! struct args \} } |
|||
31 Oct 2010, 16:50 |
|
mindcooler 31 Oct 2010, 17:22
I don't understand much what's going on in either macro, so perhaps it's best for me to cut'n'paste instead
Can't even get this to work: Code: struct IDirectSoundBuffer irp methods,QueryInterface,AddRef,CreateSoundBuffer,GetCaps,\ GetCurrentPosition,GetFormat,GetVolume,GetPan,GetFrequency,\ GetStatus,Initialize,Lock,Play,SetCurrentPosition,SetFormat,\ SetVolume,SetPan,SetFrequency,Stop,Unlock,Restore {methods rd 1} <--- Error: extra characters on line? ends _________________ This is a block of text that can be added to posts you make. |
|||
31 Oct 2010, 17:22 |
|
baldr 31 Oct 2010, 17:33
mindcooler,
restore is a reserved word. |
|||
31 Oct 2010, 17:33 |
|
mindcooler 31 Oct 2010, 17:44
So I can't even make hardcoded structs..
|
|||
31 Oct 2010, 17:44 |
|
baldr 31 Oct 2010, 19:03
mindcooler,
Probably Tomasz will bother to make those reserved words to be context-sensitive, not reserved anyway. |
|||
31 Oct 2010, 19:03 |
|
mindcooler 31 Oct 2010, 21:29
I think I'll keep my interface macro until my macro-fu is up to par.
|
|||
31 Oct 2010, 21:29 |
|
Tomasz Grysztar 31 Oct 2010, 22:19
baldr wrote: mindcooler, Code: label restore jmp restore |
|||
31 Oct 2010, 22:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.