Jump to content

Recommended Posts

Posted

Hi...

I create a DLL in C, on my DLL I'm acessing the windows DLL.

I'm having problem when I pass a parameter to the DLL's function, the functions executes but after finished, the Autoit crashes.

But when I execute the same function without passing parameters (the parameters are already on the DLL) the Autoit runs ok.

Any thoughts?

Brunomusw

Posted

You are using the wrong calling convention. Try adding ":cdecl" on the end of the return type, like "int:cdelc". See if that helps.

Richard thanks for the ideia, it didn't work but I could find the way.

The cdecl didn't work because I was calling a function on Win32 so I use the _stdcall. So the call function on C stays:

__declspec(dllexport) int _stdcall SF_Beep(DWORD par1, DWORD par2);

Thanks...

Brunomusw

Posted

Well, the crash sounded like a problem with the calling convention. It may also be that you are using the wrong parameter types. May I see the AutoIt DllCall you wrote?

Richard, It worked with the _stdcall and the function stay like I said:

CODE
__declspec(dllexport) int _stdcall SF_Beep(DWORD par1, DWORD par2);

regards,

Brunomusw

Posted

That should be DllCall($dll, ...)

Shouldn't matter though.

@OP, you're trying to call ConfigRTSDTR when you posted the declaration for SF_Beep(). ANy thoughts on that?

Broken link? PM me and I'll send you the file!

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
  • Recently Browsing   0 members

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