Jump to content

Help with DLLCall


 Share

Recommended Posts

Could someone help me with a DLLCall?

This dll should return one of the following integers depending on your speaker configuration.

mono = 0

headPhone = 17

stereo = 1

front 3ch = 2

quadro = 12

5.0 = 6

5.1 = 13

7.1 = 24

If FileExists(@ScriptDir & '\SpkCfg.dll') Then
    $a = DllCall(@ScriptDir & '\SpkCfg.dll', "int", "getSpeakerConfig")
    If @error Then
        MsgBox(0, "ERROR", "error message = " & @error)
    Else
        MsgBox(0, "SPEAKER", "The result is " & $a)
    EndIf
Else
    MsgBox(0, "ERROR", "file not found")
EndIf

I'm quite new to using dllcall so your assistance would be very appreciated.

SpkCfg.dll

Edited by Shark007
Link to comment
Share on other sites

Could someone help me with a DLLCall?

This dll should return one of the following integers depending on your speaker configuration.

mono = 0

headPhone = 17

stereo = 1

front 3ch = 2

quadro = 12

5.0 = 6

5.1 = 13

7.1 = 24

If FileExists(@ScriptDir & '\SpkCfg.dll') Then
    $a = DllCall(@ScriptDir & '\SpkCfg.dll', "int", "getSpeakerConfig")
    If @error Then
        MsgBox(0, "ERROR", "error message = " & @error)
    Else
        MsgBox(0, "SPEAKER", "The result is " & $a)
    EndIf
Else
    MsgBox(0, "ERROR", "file not found")
EndIf

I'm quite new to using dllcall so your assistance would be very appreciated.

SpkCfg.dll

DllCall returns an array if successful.

So,

MsgBox(0, "SPEAKER", "The result is " & $a)

should be

MsgBox(0, "SPEAKER", "The result is " & $a[0])

Link to comment
Share on other sites

And you successfully used it in a test under VB, or VC++, or what?

This doesn't sound much like an AutoIt issue.

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

And you successfully used it in a test under VB, or VC++, or what?

This doesn't sound much like an AutoIt issue.

I did not claim autoit had an issue. I am trying to use the dll. I have the issue.

I see nothing particularly wrong.

Are you sure SpkCfg.dll in script's dir is the one that you attached?

Yes, the dll was extracted from the latest ffdshow tryouts inno setup installer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...