Jump to content
Sign in to follow this  
autoitxp

calling dll function

Recommended Posts

autoitxp

how to call this function prams from dll created in delphi i have no idea how to use this function through auto-it

procedure Myfile(FileName : Pchar); stdcall;

DllCall("myfile.dll","long","Myfile","pchar","myfile.jpg")?
Edited by autoitxp

Share this post


Link to post
Share on other sites
trancexx

You open the help file and start reading DllCall section.

That function is for advanced users.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
smartee

hi autoitxp, :huh2:

Here's a quick example ;)

library HelloWorld;

uses
  SysUtils,
  Classes,
  Dialogs;

{$R *.res}
Procedure EchoTest(MyMessage:Pchar); stdcall;
begin
ShowMessage(MyMessage)
end;

exports EchoTest;

begin
end.
DllCall("HelloWorld.dll", "none", "EchoTest", "str", "Hello Delphi from AutoIt")

Hope this helps, :alien:

-smartee

Share this post


Link to post
Share on other sites
autoitxp

That function is for advanced users.

now this is very rude ;)

Thanks you very much

smartee :huh2:

Share this post


Link to post
Share on other sites
autoitxp

how to call this function ?

function myfiles: Boolean;

Share this post


Link to post
Share on other sites
smartee

hi again autoitxp ;),

Glad to help :huh2:

Here's another example, this time with both a parameter, and a return value :ph34r:

library HelloWorld2;

uses
  SysUtils,
  Classes;

{$R *.res}
function isOdd(testint: integer):boolean; stdcall;
begin
  Result := ((testint mod 2)=1);
end;

exports isOdd;

begin
end.
Do
    $iRandomInt = Random(1, 100, 1)
    $sAns = " is even."
    $aRet = DllCall("HelloWorld2.dll", "boolean", "isOdd", "int", $iRandomInt)
    If $aRet[0] Then $sAns = " is odd."
Until (MsgBox(65, "Result", $iRandomInt & $sAns) <> 1)

Hope this helps :alien:,

-smartee

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.