I have a simple question, but please help me... how to create Structs with functions in MASM like the C++ classes? Can I do this with MASM?
i need this... please tell me :]
Posted on 2003-04-11 13:24:59 by frk
look in the COM forum. there's a discussion going currently. Aslo if you search for "OOP" you'll find many things on it here on the board
Posted on 2003-04-11 13:35:17 by Hiroshimator
Ok I'll check them
Posted on 2003-04-11 13:37:16 by frk
From some of my old my early testings with SOL OS



.data

sol_window STRUC
lp_function1 dd ?
lp_function2 dd ?
window_x dd ?
window_y dd ?
ENDS

one_window sol_window <?>

.code

....
mov esi,offset one_window
mov eax,[esi.lp_function1]
Call eax, STDCALL, param01,param02
....

Posted on 2003-04-11 13:44:05 by BogdanOntanu


MyClass STRUCT

data1 DWORD ?
data2 DWORD ?

method1 dd offset a_method
method2 dd offset b_method

MyClass ENDS

Then somewhere else:

a_method:

***some code***

b_method:

***other code***

etc....
Posted on 2003-04-11 14:48:07 by ThoughtCriminal
I think that will work perfectly :grin: ... But i have another question... how to make macro like msgbox(params) who can be compared in 'if' like:
.if msgbox("text","text",MB_YESNO) == IDYES
;bla bla bla
.endif
:confused:
Posted on 2003-04-11 15:05:25 by frk
use vb :grin:
Posted on 2003-04-11 16:03:25 by Hiroshimator
frk,

Yes,it's off-topic:the masm32 package provides some tools for Object Orientated Programming.
Have a look at the oop folder.

Regards,

Vortex
Posted on 2003-04-12 03:20:45 by Vortex
I'll check theese tools. Hiroshimator i've used vb, that's why i need this ;)
Posted on 2003-04-12 05:04:06 by frk


I think that will work perfectly ... But i have another question... how to make macro like msgbox(params) who can be compared in 'if' like:
.if msgbox("text","text",MB_YESNO) == IDYES
;bla bla bla
.endif



This can be done with HLA without user defined macros.

code snippet:

 


if ( MessageBox ( 0, "text", "text", 0 ) = IDYES ) then

bla bla bla

endif

Posted on 2003-04-12 10:21:33 by Odyssey
mm ok how to make something like: List1.Add , ... ? Please give me an example
Posted on 2003-04-15 08:06:42 by frk

mm ok how to make something like: List1.Add , ... ? Please give me an example


Sorry bout the late reply, I've been a bit busy.

I'm trying to understand what you want. Do you want to do something like:

invoke List1.Add, foo, bar

If thats what you are looking for, I'll need to dig through some old code, but it should be possible.

It will be a day or two before I can answer.
Posted on 2003-04-17 11:55:08 by ThoughtCriminal