Sign in to follow this  
Followers 0
Aiakonai

window switching / function passing problem

4 posts in this topic

Hello I am making a simple program that requires the use of multiple windows. This program needs to be able to run on multiple operating systems as well. I was using the most recent version of autoit until I realized it would not connect tcp between a win2k computer and a winxp computer. If you have found out something that I missed that allows that to work plz tell me but, in any case, I am now using an older version which I was able to successfully connect via tcp between xp / 2k.

NOW I have a different problem

The following code is part of a much larger program. When I run this function on the winxp machine it works perfectly and has no errors. When I run it on a win2k machine the variable $uid contains what looks like a null character instead of the actual id that should have been passed.... but whats even more confusing is that that should not stop the window from being created... every time i hit this function it just does nothing.

If anyone has a recommendation for how to get the newer version of autoit to work with win2k that would be nice.. but if not I will have to revert to an even older version of autoit that is known to work with win2k.

(Has autoit dropped win2k off ???)

Func RC_createChatWindow($uid)  
    If WinExists("Chat Se") Then
    ;do nothing
    Else        
        $RC_chatWin = GUICreate("Chat Session with "&$uid,320,360,50,50,$WS_TILEDWINDOW)    
        GUISetOnEvent($GUI_EVENT_CLOSE,"RC_destroyChatWindow")
        $RC_chatMsgBoard = GUICtrlCreateEdit("",10,10,300,200)
        GUICtrlSetResizing(-1,$GUI_DOCKLEFT)
        $RC_chatSendBox = GUICtrlCreateEdit("",10,220,300,100)  
        $RC_chatSendButton = GUICtrlCreateButton("Send",260,320,50,20)  
    ;*********************************
        GUICtrlSetOnEvent(-1,"RC_sendMSG")      
        GUICtrlSetColor($RC_chatMsgBoard,0x0000ff)
        ControlFocus("Chat Session with "&$uid,"",$RC_chatSendBox)
        GUISetState()   
        GUISetState(@SW_HIDE,$RC_mainWindow)
        HotKeySet("{ENTER}","RC_sendMSG")       
    EndIf
EndFunc

hmm... I wonder which key is the any key :O

Share this post


Link to post
Share on other sites



As far as TCP functions not working in newer versions, syntax/UDF changes are a more likely explanation than dropped 2k support.

I've compiled my TCP scripts with the latest versions, and haven't had any issues between OS versions.

How are you populating the value you're passing as $uid? Where do you think the "null character" is coming from?

Are you certain that "Chat Se" doesn't exist? For debugging purposes, ";do something" instead of ";do nothing".


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

As far as TCP functions not working in newer versions, syntax/UDF changes are a more likely explanation than dropped 2k support.

I've compiled my TCP scripts with the latest versions, and haven't had any issues between OS versions.

How are you populating the value you're passing as $uid? Where do you think the "null character" is coming from?

Are you certain that "Chat Se" doesn't exist? For debugging purposes, ";do something" instead of ";do nothing".

I am going to redownload the newest version and try to work it out.

I filled uid using

_GUICtrlComboBox_GetEditText() .... the problem seems to occur when reading from the combo box itself.

on windows xp there is no error with it. but on win2k I never even reach the createchatwindow function muttley

Func RC_addperson()
    Dim $comboText = _GUICtrlComboBox_GetEditText($RC_mainUserListBox)
    debug("combo text in addperson = ",$comboText)  
    RC_connectTo($comboText)
    debug("RC_addperson","before clearing RC_mainUserListBox")
    debug("main box id is ",$RC_mainUserListBox)    
EndFunc

Func RC_connectTo($uid)
    debug("uid",$uid)
    If _GUICtrlComboBox_FindStringExact($RC_mainUserListBox,$uid) <> -1 Then
        debug("valid entry in ", "RC_connectTo")
        $connectionList[0] = $uid
        RC_createChatWindow($uid)
    Else
        debug("invalid entry in ","RC_connectTo")       
    EndIf
EndFunc

in win2k $uid contains "" ???

in xp $uid contains the letter "a" ...... which is what I typed in both times and I checked both combo boxes...

which both contained the letter a

ill try to redo it in the newer version and see if I can get the syntax issue worked out.


hmm... I wonder which key is the any key :O

Share this post


Link to post
Share on other sites

I have converted the program to run in the newer version but I'm still getting the same error.

In win2k when I get to the part where I read from the combo box I get some strange character.

but the same exact code when run from winxp does not do this.

Func RC_addperson()
    Dim $comboText = _GUICtrlComboBox_GetEditText($RC_mainUserListBox); this is the line that I'm talking about
    debug("combo text in addperson = ",$comboText)
;add the actual code to connect to a user here
;_GUICtrlEdit_AppendText($RC_mainConnectedList,$comboText&@CRLF)    
    RC_connectTo($comboText)
    debug("RC_addperson","before clearing RC_mainUserListBox")
    debug("main box id is ",$RC_mainUserListBox)    
EndFunc

Func RC_connectTo($uid)
    debug("connect","to")
    debug("uid",$uid)
    If _GUICtrlComboBox_FindStringExact($RC_mainUserListBox,$uid) <> -1 Then
        debug("valid entry in ", "RC_connectTo")
        $connectionList[0] = $uid
        RC_createChatWindow($uid)
    Else
        debug("invalid entry in ","RC_connectTo")       
    EndIf
EndFunc

hmm... I wonder which key is the any key :O

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