Sign in to follow this  
Followers 0
autoitxp

calling dll function

6 posts in this topic

#1 ·  Posted (edited)

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



#2 ·  Posted (edited)

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

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

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

how to call this function ?

function myfiles: Boolean;

Share this post


Link to post
Share on other sites

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  
Followers 0