Jump to content
Sign in to follow this  
Shark007

Help with DLLCall

Recommended Posts

Shark007

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

Share this post


Link to post
Share on other sites
Malkey

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

Share this post


Link to post
Share on other sites
Shark007

I still get error message 1, unable to use the DLL file

I assume my DLLCall is poorly formatted, but really do not know.

This is what I cannot get past.

Edited by Shark007

Share this post


Link to post
Share on other sites
Shark007

The dll is taken from the ffdshow inno setup.

The only documentation I could find was through the ffdshow SVN repository.

Edited by Shark007

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
trancexx

I see nothing particularly wrong.

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


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Shark007

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.

Share this post


Link to post
Share on other sites
Shark007

ok, i found my problem. I wasnt paying attention to architecture.

I am working on an x64 system, and it was compiling an x64 executable with a 32bit dll.

All is fine. thanks for the assistance.

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.