Hi all,
I've got a problem with structures in winmm API(or any windows API). I writing a prog to recieve MIDI in sysex messages in which I use a callback routine.
In WndProc, if I declare an instance of the MIDIHDR structure as LOCAL, I can't refer to it in the callback routine. How do I do I get at it in both procs? I realise there's probably a simple answer but I just can't find a way of doing it. I've read the docs and been through loads of tutorials, but haven't found anything yet.
For instance:
a_proc proc
LOCAL midiHdr:MIDIHDR
mov eax,offset sysbuf
mov midiHdr.lpData,eax
a_proc endp
b_proc proc
mov eax,midiHdr.lpData ;Never heard of it!!
b_proc endp
How do I give midiHdr global scope? :red
Thanks,
Andy
Hi Andy,
try putting it in the .data or .data? section and it will be available from anywhere.
Regards
Hi all,
Thanks mnemonic, I did try that but it threw errors. What format should I use?
Andy
To use the default initializers:
midiHdr MIDIHDR <>
Or to initialize dwBufferiLength to 100:
midiHdr MIDIHDR <,100>
etc
Hi all,
That did the job! Thanks :U
Andy.