Sign in to follow this  
Followers 0
Casper2400

*Solved* IniRead with Send using Delphi

10 posts in this topic

#1 ·  Posted (edited)

Hello all, it has been a very long time since my last post and I am stummped.

I am learning delphi and how to use autoit with delphi.

I have AutoItXWrapper and AutoItX3.dll

most of the code is quite simple and almost the same as just coding with autoit.

However I have ran into a bit of a snafu:

AU3_IniRead('./OH_BOT.ini', 'UserInfo', 'AccountName', '');

after a few seconds I will get a debugger fault notification error.

so I just use delphi inifile.ReadString('UserInfo', 'AccountName','');

now I need AU3_send to post the result of ini "accountname" to the active window where the curser is waiting.

any ideas?

Edited by Casper2400

I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites



So what is the problem? Just use the return value from the Delphi function to call the send function with.

Share this post


Link to post
Share on other sites

So what is the problem? Just use the return value from the Delphi function to call the send function with.

The "return" value is not working, thats the problem...

When I type AU3_Send (result) I get an error "not enough peramaters

When I type AU#_Send (result,0) I get error "string and PAnsi... incompatible

When I type AU3_Send ('result',0) it sends "result" to the box not the ini string.

In Delphi I can not find a "return" function for a string to post to the active window (not mine)


I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites

What is PAnsi? Is that a Delphi string type? It looks as if you need to use a compatible string type, "string", to call AU3_Send.

Share this post


Link to post
Share on other sites

the PAnsi... is a delphi type code (unknown to me)

The au3_send code I got directly from autoit.

The problem is when I read the ini with au3_readini I get an error, SO I read the ini with delphi code.

NOW I want to post the result to the open window.

Delphi does not (that I have found) have a way to post string to another application, only post key strokes)

AU3_send is what I need to use, what I am not finding is HOW to send with au3_send from a delphi Ini read...

If I use AU3_Send ('what I type here shows up',0) I need it to post the result from the iniread....


I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites

What I am saying is that the type returned from the Delphi INI function returns an abnormal string type according to your message. I don't know anything about Delphi at all, but can you cast the PAnsi returned from the Delphi INI function to a string? Like in C++ where you do (string)variable?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I think I found the problem.

in my wrapper I changed this code:

procedure AU3_Send(const szSendText: PChar; {[in,defaultvalue(0)]} nMode: longint); stdcall; external AU3_DLL;

to this

procedure AU3_Send(const szSendText: string; {[in,defaultvalue(0)]} nMode: longint); stdcall; external AU3_DLL;

now it sends the ini info with no problems. So after a lot of reading I found that Delphi dont much like PChar code :rolleyes:

so continuing on with the remainder of my project.

Thank you all for your assistance

Edited by Casper2400

I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Edit: You replied while I was researching. Sorry I couldn't have been of more assistance. Edited by Mr Icekirby

Share this post


Link to post
Share on other sites

Nonsense!!!

You have been helpful, your comment got me looking in the area where the code was trying to get the pchar rather than a string :rolleyes:


I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it.

Share this post


Link to post
Share on other sites

Ok, well, I'm glad I was available then. I may not know much about some languages, but I can guess at most syntax problems.

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