AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange Problem with COM...

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
JimKarvo



Joined: 09 Jan 2009
Posts: 104

PostPosted: Mon May 25, 2009 7:50 pm    Post subject: Strange Problem with COM... Reply with quote

Hello..
I use that line:
Code:
COM_Invoke(itemtbUsername:=COM_Invoke(all1:=COM_Invoke(document:=COM_Invoke(pwb,"Document"),"All"),"Item","tbUsername"),"value","6978046100")


If I write full the "6978046100" the script writes byself, "-1611888492"
If I use "697804610" all is ok.. but I want to use the "6978046100"


Any ideas?


Last edited by JimKarvo on Mon May 25, 2009 8:33 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
sinkfaze



Joined: 18 Mar 2008
Posts: 5043
Location: the tunnel(?=light)

PostPosted: Mon May 25, 2009 8:18 pm    Post subject: Reply with quote

If you're using this for a website, I think you should be able to condense the call down to this:

Code:
COM_Invoke(pwb,"document.all.item[tbUsername].value","6978046100")


Try that call and see if there's any difference. I've seen problems sending leading zeroes but never trailing zeroes.
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
JimKarvo



Joined: 09 Jan 2009
Posts: 104

PostPosted: Mon May 25, 2009 8:26 pm    Post subject: Reply with quote

Generally, because of I am trying to learn the COM fuctions (for websites for now) are there any documation for the "COM_Invoke()" and its syntax?
Back to top
View user's profile Send private message MSN Messenger
JimKarvo



Joined: 09 Jan 2009
Posts: 104

PostPosted: Mon May 25, 2009 8:28 pm    Post subject: Reply with quote

sinkfaze wrote:
If you're using this for a website, I think you should be able to condense the call down to this:

Code:
COM_Invoke(pwb,"document.all.item[tbUsername].value","6978046100")


Try that call and see if there's any difference. I've seen problems sending leading zeroes but never trailing zeroes.


No solution.. The same problem.. Sad
Back to top
View user's profile Send private message MSN Messenger
JimKarvo



Joined: 09 Jan 2009
Posts: 104

PostPosted: Mon May 25, 2009 8:34 pm    Post subject: Reply with quote

Is it possible to save the "6978046100" to a var and pass that number to COM? Because the "%var%" don't work.. [it writes "%var%" instead of the var's contain..]
Back to top
View user's profile Send private message MSN Messenger
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Mon May 25, 2009 9:37 pm    Post subject: Reply with quote

yes, leave off the percent signs

Code:
var = 6978046100
COM_Invoke(pwb,"document.all.item[tbUsername].value", var)
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
sinkfaze



Joined: 18 Mar 2008
Posts: 5043
Location: the tunnel(?=light)

PostPosted: Mon May 25, 2009 9:42 pm    Post subject: Reply with quote

JimKarvo wrote:
No solution.. The same problem.. Sad


Hmm...you might try this and see if it works...

Code:
COM_Invoke_(pwb,"document.all.item[tbUsername].value",VT_BSTR:=8,"6978046100")


Also, are you getting any error messages? Are you able to successfully send COM calls to other fields without this problem?
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Tue May 26, 2009 1:33 am    Post subject: Reply with quote

What happened was essentially this.
Code:
x := "   "
NumPut(6978046100, x, 0, "int")
MsgBox % NumGet(x, 0, "int")

You cannot use a number out of range of (un)signed 32-bit integers in COM_Invoke, unless you pass it as a string.
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Tue May 26, 2009 3:00 am    Post subject: Reply with quote

SinkFaze answer works(passes the number as a string) You should use it
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
Jim.Karvo
Guest





PostPosted: Tue May 26, 2009 1:00 pm    Post subject: Reply with quote

sinkfaze wrote:
JimKarvo wrote:
No solution.. The same problem.. Sad


Hmm...you might try this and see if it works...

Code:
COM_Invoke_(pwb,"document.all.item[tbUsername].value",VT_BSTR:=8,"6978046100")


Also, are you getting any error messages? Are you able to successfully send COM calls to other fields without this problem?


It is ok, but How Could I save the mobile number to a var, and then pass it?

That code doesn't work...
Code:

var = 6978046100
COM_Invoke_(pwb,"document.all.item[tbUsername].value",VT_BSTR:=8, var)
Back to top
sinkfaze



Joined: 18 Mar 2008
Posts: 5043
Location: the tunnel(?=light)

PostPosted: Tue May 26, 2009 1:11 pm    Post subject: Reply with quote

Jim.Karvo wrote:
That code doesn't work...
Code:

var = 6978046100
COM_Invoke_(pwb,"document.all.item[tbUsername].value",VT_BSTR:=8, var)


Try this:

Code:

var = 6978046100
COM_Invoke_(pwb,"document.all.item[tbUsername].value",VT_BSTR:=8, "" var "")

_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Tue May 26, 2009 3:25 pm    Post subject: Reply with quote

there is no reason that it would need the double quotes

there are really only 2 options here
your getting a COM error or you have disabled the prompt
if you have disabled the prompt
then what does this return
Code:
msgbox % COM_Invoke(pwb,"document.all.item[tbUsername].outerHTML")
if it returns nothing then its an invalid dom reference or your attempting to manipulate it before its available
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group