Jump to content
Excelsior Forums
bohdan

Get & pass "address" of structure..

Recommended Posts

Hi!

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":

WinAPI:

      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):

WinAPI:

     typedef struct {

          DWORD           dwCallback;  

          MCIDEVICEID  wDeviceID;

          LPCSTR            lpstrDeviceType;

          LPCSTR            lpstrElementName;

          LPCSTR            lpstrAlias;

     } MCI_OPEN_PARMS;

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

×