Casper2400 Posted June 23, 2007 Share Posted June 23, 2007 (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 June 26, 2007 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. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 24, 2007 Share Posted June 24, 2007 So what is the problem? Just use the return value from the Delphi function to call the send function with. Link to comment Share on other sites More sharing options...
Casper2400 Posted June 24, 2007 Author Share Posted June 24, 2007 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 peramatersWhen I type AU#_Send (result,0) I get error "string and PAnsi... incompatibleWhen 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. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 25, 2007 Share Posted June 25, 2007 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. Link to comment Share on other sites More sharing options...
Casper2400 Posted June 25, 2007 Author Share Posted June 25, 2007 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. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 25, 2007 Share Posted June 25, 2007 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? Link to comment Share on other sites More sharing options...
Casper2400 Posted June 26, 2007 Author Share Posted June 26, 2007 (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 so continuing on with the remainder of my project. Thank you all for your assistance Edited June 26, 2007 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. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 26, 2007 Share Posted June 26, 2007 (edited) Edit: You replied while I was researching. Sorry I couldn't have been of more assistance. Edited June 26, 2007 by Mr Icekirby Link to comment Share on other sites More sharing options...
Casper2400 Posted June 28, 2007 Author Share Posted June 28, 2007 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 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. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 28, 2007 Share Posted June 28, 2007 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now