Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: timer / doevents / inet problem

  1. #21
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: timer / doevents / inet problem

    Marting,

    try the following, change from:
    [code=thinbasic] function = UTF8ToAnsi$(strdata)[/code]
    to
    [code=thinbasic] function = acode$(UTF8ToWideChar$(strdata))[/code]
    in function "download"

    Mainly you need to pass from UTF8 to Unicode to Ansi.

    I'm still studying how those conversions take place, to be honest I'm not an expert of this field.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #22
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: timer / doevents / inet problem

    Martin,

    I just saw your example. Why are you making that DO/LOOP like:
    [code=thinbasic]
    do
    hInternet = INET_Internet_Open("test", %INTERNET_OPEN_TYPE_DIRECT)
    IF hInternet <> %NULL THEN EXIT DO
    loop
    [/code]

    Problem is that if function fails and hInternet will be zero, ode will enter into an infinite loop.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #23
    Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Age
    52
    Posts
    248
    Rep Power
    40

    Re: timer / doevents / inet problem

    whoohoo that works perfect!

    I know that this loop can be endless. What my script does is testing a lot of internetpages and then it put the results in a listview. So this download-function is called from a timer routine. So the main script is still running and my thought was that the loop will end if the internet connection is restored. But I agree I must think about a better way.

  4. #24
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: timer / doevents / inet problem

    Quote Originally Posted by martin
    whoohoo that works perfect!
    Seems a good start
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Page 3 of 3 FirstFirst 123

Similar Threads

  1. INET download issue
    By nrodes in forum thinBasic General
    Replies: 1
    Last Post: 03-06-2009, 22:17

Members who have read this thread: 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •