Jump to content
Excelsior Forums

Get & pass "address" of structure..

Recommended Posts


Will be very thankfull if anybody have a clue how to solve the following.

I'm trying to call "mciSendCommand" from Windows media-library "winmm.dll":


      MCIERROR mciSendCommand(

               MCIDEVICEID IDDevice,      

               UINT uMsg,      

               DWORD fdwCommand,      

               DWORD dwParam      


The problem is that dwParam is supposed to be for instance the address (just as dword or int) of the following structure (this may vary):


     typedef struct {

          DWORD           dwCallback;  

          MCIDEVICEID  wDeviceID;

          LPCSTR            lpstrDeviceType;

          LPCSTR            lpstrElementName;

          LPCSTR            lpstrAlias;


I was thinking to pass "address" of this structure as a pointer but signature is not accepted then... looks like I have to pass "integer" but how to get this integer..? While programming in Delphi I just simply passing something like "Longint(@OpenParm)" and everything works well.

Moreover depending on the command I need sometimes I need to check return results that will be stored in this (similar anyway) "structure" after invokation.

Is it possible to sort this out just with help of xFunction or I should write my "transition" dll to arrange this.

Thanks in advance.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now