Recent

Author Topic: Windows 10 vs Windows 11  (Read 1124 times)

stansbkg

  • New Member
  • *
  • Posts: 28
Windows 10 vs Windows 11
« on: June 27, 2023, 05:16:27 pm »
I am scraping data from a web page. The instruction
     page := client.get(' [target URL] ');
works fine on a Windows 10 machine, but the idetical program fails to download on a Windows 11 machine.
For both machines, I'm using Version 1.0.12 2021/05/15 (Complier 'version 3.2.2). Is there a difference between Windows 10 and Windows 11 implementation?

domasz

  • Sr. Member
  • ****
  • Posts: 312
Re: Windows 10 vs Windows 11
« Reply #1 on: June 27, 2023, 05:22:28 pm »
What library you use? Is the url http:// or https://? What version of Lazarus?

stansbkg

  • New Member
  • *
  • Posts: 28
Re: Windows 10 vs Windows 11
« Reply #2 on: June 27, 2023, 05:51:09 pm »
This is at the start of the code:

   {$mode objfpc} {$ifdef windows} {$apptype console} {$endif}
   Uses
     sysutils, classes, fphttpclient, openssl, opensslsockets, dos, kgs;

"kgs" is a unit I wrote.

How do I determine the version of Lazarus?

stansbkg

  • New Member
  • *
  • Posts: 28
Re: Windows 10 vs Windows 11
« Reply #3 on: June 27, 2023, 06:07:48 pm »
I have tried both http & https, and the same results happen.

TRon

  • Hero Member
  • *****
  • Posts: 1841
Re: Windows 10 vs Windows 11
« Reply #4 on: June 27, 2023, 06:32:43 pm »
This is at the start of the code:
No actual code, then it is not possible to determine the mistake/error/incompatibility. You do not even mention the error code that you receive let alone if you check for that. All we have now is a "it does work here, it does not work there"

There is no difference between windows versions when it comes to httpclient. What can be different however is the version of the ssl libraries (and/or bitness).

Quote
How do I determine the version of Lazarus?
not important as you seem to be using the TUI IDE version of Pascal.

For examples on how to use httpclient, see https://wiki.freepascal.org/fphttpclient
« Last Edit: June 27, 2023, 06:34:31 pm by TRon »

stansbkg

  • New Member
  • *
  • Posts: 28
Re: Windows 10 vs Windows 11
« Reply #5 on: June 27, 2023, 08:37:30 pm »
My code uses the "try...except" statement, "try" is followed by the "Page :=..." statement in my first post. My Windows 11 machine executes the "except" portion, but I don't see any failure code. The Windows 10 machine bypasses the "except" portion.

Soner

  • Sr. Member
  • ****
  • Posts: 302
Re: Windows 10 vs Windows 11
« Reply #6 on: June 27, 2023, 08:47:13 pm »
What is the exception message or code?
Use this:
Code: Pascal  [Select][+][-]
  1.  try
  2.    page := client.get(' [target URL] ');
  3.  except
  4.    On E:Exception do ShowMessage(E.Message);
  5.  end;
  6.  

stansbkg

  • New Member
  • *
  • Posts: 28
Re: Windows 10 vs Windows 11
« Reply #7 on: June 27, 2023, 08:55:09 pm »
Compiler said -- Error: Identifier not found "ShowMessage"

TRon

  • Hero Member
  • *****
  • Posts: 1841
Re: Windows 10 vs Windows 11
« Reply #8 on: June 27, 2023, 09:09:51 pm »
Replace the showmessage with a writeln. TS is not using Lazarus so showmessage is not available.

Besides that, if you run the application in a terminal window it should show the exception no matter what.

stansbkg

  • New Member
  • *
  • Posts: 28
Re: Windows 10 vs Windows 11
« Reply #9 on: June 27, 2023, 09:41:34 pm »
New compiler message -- Error: Identifier not found "On"
I'm really confused now. It compiled with "Showmessage," but gave this error message when I replaced it with "writeln."

I will proceed using only the version on my Windows 10 machine. You've been very helpful and patient. Thanks.

TRon

  • Hero Member
  • *****
  • Posts: 1841
Re: Windows 10 vs Windows 11
« Reply #10 on: June 27, 2023, 09:45:25 pm »
Compile your application with mode OBJFPC or mode DELPHI and include unit sysutils in your uses clause..

Thaddy

  • Hero Member
  • *****
  • Posts: 13235
Re: Windows 10 vs Windows 11
« Reply #11 on: June 28, 2023, 03:35:00 pm »
Replace the showmessage with a writeln. TS is not using Lazarus so showmessage is not available.

Besides that, if you run the application in a terminal window it should show the exception no matter what.
Or use a little macro:
Code: Pascal  [Select][+][-]
  1. {$macro on}{$define ShowMessage := WriteLn}
I actually get compliments for being rude... (well, Dutch, but that is the same)

stansbkg

  • New Member
  • *
  • Posts: 28
Re: Windows 10 vs Windows 11
« Reply #12 on: June 29, 2023, 06:29:22 pm »
I found what was the problem.

ssleay32.dll and libeay32.dll were in the wrong folder on the offending computer.

 

TinyPortal © 2005-2018