Windows error code not documented

Hi,

I’m trying two methods to check the computer’s sound volume under Windows. One involves the WindowsAudioMixerMBS and the other is using declares.

For both of them, I’m getting an error code (1024) for which I can’t find any information. It’s not referenced in Windows error codes list, the utility Err_6.4.5.exe won’t find anything and no Google result.

For the record, this is the declare I’m trying:

Declare Function mixerGetLineInfoA lib "Winmm" (hmxobj as integer,ByRef pmxl as Ptr,fdwInfo as Int32) as Integer

Var mb As new MemoryBlock(MixerLine.Size)

mb.Int32Value(0)=MixerLineObj.Size
Var p As Ptr=mb
Var i As Integer=mixerGetLineInfoA(MixerHandle,p,3) //3: volume, 2: mute
mb=p
if i<>0 then Break

I’ve spent 3 hours with this issue today. Any help welcome.

#define MIXERR_BASE 1024
#define MIXERR_INVALLINE (MIXERR_BASE + 0)

MIXERR_INVALLINE

The audio line reference is invalid.

1 Like

Wow, you found it fast!
A big thanks!
Have you found this data inside some headers?

Now, it’s weird the WindowsAudioMixerMBS class’ Lasterror encounters this just by querying its properties… I’ll try to isolate which triggers this and inspect…

If you look at the bottom of the msdn, the headers are usually listed, and I just google that with either github or pinvoke in front, saves me from having to search sdk’s on local as someone has more often that not uploaded it.

I’d also recommend using W’s instead of A’s for calls as xojo isn’t internally ansi any more.

Take the byref off the pointer or you’re sending a pointer to a pointer to a struct over.