I often have to pull data from files that are on a lot of cds so I created a program that will read the data with a button click. I want to be really lazy though and I want the cd-rom drive to open after it finishes reading the cd. Actually it would be helpful in that it also lets me know when it is finished reading the cd while I'm working on other things. So I found this.
To use as:
or
But I always get the following error:
How can I fix this or is there another way to do it?
-I hate Microsoft!
-Forever and always forward.
Code:
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
(ByVal lpszCommand As String, ByVal lpszReturnString As String, _
ByVal cchReturnLength As Long, ByVal hwndCallback As Long) As Long
To use as:
Code:
mcdSendString("set CDAudio door open", 0, 0, 0)
Code:
mcdSendString("set CDAudio door open", retValstring, 127, IntPtr.Zero)
But I always get the following error:
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'CompileCDs!CompileCDs.main_frm::mciSendString' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
How can I fix this or is there another way to do it?
-I hate Microsoft!
-Forever and always forward.