Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,277
» Latest member: mayavaranasi
» Forum threads: 2,152
» Forum posts: 10,481

Full Statistics

Online Users
There are currently 428 online users.
» 0 Member(s) | 425 Guest(s)
Bing, Google, Yandex

Latest Threads
Dummy div in a IWRegion
Forum: IntraWeb General Discussion
Last Post: StephB
9 hours ago
» Replies: 2
» Views: 48
Create components at runt...
Forum: IntraWeb General Discussion
Last Post: PaulWeem
04-23-2024, 10:27 PM
» Replies: 1
» Views: 63
message when added TIWDBN...
Forum: IntraWeb General Discussion
Last Post: Mike_A
04-22-2024, 02:09 PM
» Replies: 6
» Views: 1,222
303 Redirect and Response...
Forum: IntraWeb General Discussion
Last Post: ALW2019
04-22-2024, 01:25 PM
» Replies: 3
» Views: 500
IW 15.5.9 IWChart
Forum: IntraWeb General Discussion
Last Post: PaulWeem
04-22-2024, 07:16 AM
» Replies: 2
» Views: 221
Data Decimation in ChartJ...
Forum: IntraWeb General Discussion
Last Post: iwuser
04-22-2024, 06:51 AM
» Replies: 8
» Views: 1,546
ClassicRegionDraw
Forum: IntraWeb General Discussion
Last Post: JuergenS
04-17-2024, 05:35 PM
» Replies: 0
» Views: 155
CompressorImplementation
Forum: IntraWeb General Discussion
Last Post: JuergenS
04-17-2024, 05:27 PM
» Replies: 0
» Views: 143
IntraWeb 15.6.0 is out!
Forum: IntraWeb General Discussion
Last Post: Comograma
04-17-2024, 11:54 AM
» Replies: 11
» Views: 950
How to manage forms and v...
Forum: IntraWeb General Discussion
Last Post: David1
04-17-2024, 10:37 AM
» Replies: 0
» Views: 136

 
  AV running demo XII/Delphi/HTMLEditor
Posted by: jeroen.rottink - 09-09-2020, 10:42 AM - Forum: IntraWeb General Discussion - Replies (3)

I was curious about the /$/iwedit feature but can't find info about it.

There are however demos using this feature:

  • XII/Delphi/HTMLEditor
  • XII/Delphi/IWWiki
After making small changes to the first project to make it compile, I get an AV hitting the button to edit the index.html file.

Should this feature still work under IW15?

Print this item

  Problem with getting session list
Posted by: martin.andersen@amesto.dk - 09-09-2020, 09:40 AM - Forum: IntraWeb General Discussion - Replies (8)

Hi!
In order to let some forms be terminated I get the session list with; gSessions.GetList(alst); as one of the last things in  the event IWServerControllerBaseNewSession() in the server control unit
But it will almost always not work the second time around, the first time is OK.
I've tried to push it to a later time, when the form is up and running (with a timer 5000), but it is the same behaviour.
Thx Martin

Code:
procedure TIWServerController.CleanUpForms(ASession: TIWApplication);
var
  alst:     TStringList;
  aid:      string;
  app:      TIWApplication;
  exp, al:  boolean;
  ok:       boolean;
  cnt:      integer;
begin

  if _LogEnabled then
    _Log('Trying to clean-up session list');

  try
    ok:=false;
    cnt:=0;
    repeat
      alst:=TStringList.Create;
      try
        gSessions.GetList(alst);
        ok:=true;
      except
        Inc(cnt);
        if cnt = 100 then begin
          if _LogEnabled then
            _Log('**Warning: Could not retrieve session list from IntraWeb platform');
          Exit;
        end;
        Sleep(50);
      end;
    until ok;

    if _LogEnabled then begin
      if cnt > 0 then
        _Log('Retry count is: ' + IntToStr(cnt));
      _Log('Number of sessions currently in the list: ' + IntToStr(alst.Count));
    end;

    for aid in alst do begin
      if aid <> ASession.AppID then begin
        app:=gSessions.LookupAndLock(aid, exp, al);
        if Assigned(app) and not exp then begin
          if app.Name = ASession.Name then begin
            if _LogEnabled then
              _Log('Session "' + app.AppID + '" will be terminated');
            app.Unlock;
            app.Terminate;
            app.Free;
          end else begin
            app.Unlock;
          end;
        end;
      end;
    end;

  finally

    alst.Free;

  end;

  if _LogEnabled then
    _Log('Number of sessions (from gSessions): ' + IntToStr(gSessions.Count));

end;

Print this item

  The visibility of variables
Posted by: Сергей Александрович - 09-09-2020, 02:52 AM - Forum: IntraWeb General Discussion - Replies (2)

Please help me. I can't figure out how to see (use) the variable described in the program in a JavaScript script. For example:

Public
mTextToPrint: String;
.....
procedure TfmViewCheck.IWAppFormShow(Sender: TObject);
begin
mTextToPrint := 'Текст для печати';
end;

язык JavaScript :
alert (mTextToPrint); - does not work

Print this item

  Get Back Button Click Event
Posted by: 41linea45 - 09-05-2020, 10:08 AM - Forum: IntraWeb General Discussion - Replies (3)

Hello

How can i know when user press back button in web browser in Intraweb 15?

How should set Back button operations in server controller and forms?

Thanks for advance.

Print this item

  The Ultimate Guide for using indy with ssl on other platforms!
Posted by: Ahmed Sayed - 09-03-2020, 08:48 PM - Forum: Indy General Discussion - No Replies

I know that I discussed this before in other forums but I can't get a tutorial on how to do things exactly regarding using Indy clients with ssl. On windows it is easy but on other platforms it is a bit tricky since there are a lot of API and versions changes to android or iOS. I searched this a lot on stackoverflow or Idera forums but I can't get a step by step example.

For instance on android I know there is BoringSSL now when was it supported and on which android version OpenSSL won't work. I know that there is a away to trick the OS to load OpenSSL files for indy but this work on new android versions as well but only old versions. 

And what About linux does it use the same dlls?

Print this item

  Indy 10 + OpenSSL: error:140A90F1:lib(20):func(169):reason(241)
Posted by: ZGabrovski@gmail.com - 09-03-2020, 09:55 AM - Forum: Indy General Discussion - Replies (7)

I have a problem with OpenSSL libraries (libeay32.dll and ssleay32.dll), version 1.02.u (but the same issue with older releases), Windows 64, both Embarcadero Delphi 10.3 Rio and Lazarus 2.1 (FPC 3.3.1) - from the trunk.

The problem is in my multi-threading application, which uses TIdHTTP.Get() for consuming data from a REST api (using SSL/TLS) and picture download function:

Code:
begin
  Result := TMemoryStream.Create;
  Http := TIdHttp.Create(nil);
  IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
  IOHandler.SSLOptions.SSLVersions := [sslvSSLv2, sslvSSLv23, sslvSSLv3, sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2];
  Request := TIdHTTPRequest.Create( Http );
  Request.UserAgent := UserAgent;

  HTTP.Request := Request;
  HTTP.IOHandler := IOHandler;

  try
    try
      ii := 0;
      repeat
        Result.Position := 0;
        Http.Get(AURL, Result);
        Result.Position := 0;
        Result.read( Buffer, 20 );
        Inc(ii);
      until  CheckValidPicture( Buffer )or (ii>2);
      if (ii>2) then
        Result.Clear;
      Result.Position := 0;
    except
      // Just in case - second try
      try
      ii := 0;
      repeat
        Result.Position := 0;
        Http.Get(AURL, Result);
        Result.Position := 0;
        Result.read( Buffer, 20 );
        Inc(ii);
      until  CheckValidPicture( Buffer ) or (ii>2);;
      if (ii>2) then
        Result.Clear;

      Result.Position := 0;

      except
      if (ii>2) then
        Result.Clear;

      end;
    end;
  finally
    Http.DisposeOf;
    Request.DisposeOf;
    IOHandler.DisposeOf;
  end;

When I am executing the code for a first time, everything is OK.
But, on second code execution(in other thread), I received the following exception core:

Error creating SSL context:error:140A90F1:lib(20):func(169):reason(241)

in HTTP.Get method.

So after some debug in Indy sources, I found that the problem comes in execution of method "SSL_CTX_new" in unit IdSSLOpenSSL, line 3156:

Code:
  // create new SSL context
  fContext := SSL_CTX_new(SSLMethod);
    if fContext = nil then
      EIdOSSLCreatingContextError.RaiseException(RSSSLCreatingContextError);
  end;

  //set SSL Versions we will use

After some google research, I found this:
https://curl.haxx.se/mail/lib-2018-07/0057.html

and modify Indy code like described:

Code:
  // create new SSL context
  fContext := SSL_CTX_new(SSLMethod);
  if fContext = nil then begin
    OpenSSL_add_all_digests;
    fContext := SSL_CTX_new(SSLMethod);
    if fContext = nil then
      EIdOSSLCreatingContextError.RaiseException(RSSSLCreatingContextError);
  end;
  //set SSL Versions we will use

and now everything works fine.

Is this OK?

and if it is, how to modify Indy source code ( is there some bug tracker or whatever, to create issue)?

Print this item

  Error 1053: When starting a new service
Posted by: TiredDev - 09-02-2020, 05:03 PM - Forum: IntraWeb General Discussion - Replies (2)

We use several AWS servers, all the same configuration. On one of them we can start around 20 services with no problem. But when we try to add one more we instantly get the 

Error 1053: [font=Arial, "Helvetica Neue", Helvetica, sans-serif][i]The service did not respond to the start or control request in a timely fashion[/font][/i] 

We've added a lengthier time out but that didn't help. Didn't think it would as the error comes up right away. Now, If I stop one of the services, and try to start the one that previously failed, it comes up just fine. So it behaves like there is a limit. AWS say they have no such limit. Plus, we have quite a few more running on other servers with no such problem.

Any ideas?


IntraWeb 14.1.14
2012 Server R2

Print this item

  Use TIdHttp inside TThread anonymous function doesn't raise exceptions
Posted by: Ahmed Sayed - 09-02-2020, 01:20 AM - Forum: Indy General Discussion - Replies (6)

Hi all,

I am using a subclass of TIdHttp to expose DoRequest function. I use it in a tool similar to Rest Debugger so what I want to achieve regardless of the code because I can't show it. But I am pretty sure you will get the idea.

I use this new class inside a thread so I can handle files downloads and uploads with progress bars correctly without blocking the UI, and I do all the necessary synchronizations with the UI. My only problem is client side exceptions for example when I do a request and the server is not running nothing happens at all. Nothing is shown in the memo or as dialog message. I understand that this behaviour is because I am executing the request inside a thread. 

I want to catch any exception that was raised on the server with error code 500 inside a TMemo as long as any response message, and any exception that is not related to server side internal errors to be displayed normally in a dialog message box.

now this is not the actual code but it is similar:


Code:
__fastcall TIdHttpEx::TIdHttpEx(TComponent *Owner)
    : TIdHTTP(Owner)
{
HTTPOptions = TIdHTTPOptions() >> hoWantProtocolErrorContent;
FHTTPBody.reset(new TIdHTTPBody);
FHTTPBody->IdHTTP = this;

FHasErrorResponse = false;
FRaiseExceptionOn500 = true;
FLastErrorResponse = "";
}
//---------------------------------------------------------------------------
int __fastcall TIdHttpEx::DoExecute(String AMethod, String AURL, TStream* AResponseContent, TStream* ARequestContent)
{
try
    {
    FHasErrorResponse = false;
    FLastErrorResponse = "";

    if (FHTTPBody->RequestStream == nullptr && ARequestContent != nullptr)
        FHTTPBody->RequestStream = ARequestContent;

    if (FHTTPBody->ResponseStream == nullptr && AResponseContent != nullptr)
        FHTTPBody->ResponseStream = AResponseContent;

    if (FHTTPBody->ResponseStream == nullptr && AResponseContent == nullptr)
        FHTTPBody->ResponseStream = new TMemoryStream;

    DoRequest( AMethod, AURL, FHTTPBody->RequestStream, FHTTPBody->ResponseStream,nullptr,-1);

    FResponseOk = (ResponseCode == 200);

    if (FHTTPBody->ResponseStream != nullptr)
        FHTTPBody->ResponseStream->Position = 0;
    }
catch (const EIdHTTPProtocolException &E)
    {
    if (FRaiseExceptionOn500)
        throw Exception(E.ErrorMessage);
    else
        {
        FLastErrorResponse = E.ErrorMessage;
        FHasErrorResponse = (FLastErrorResponse.Trim() != "");
        DoHTTPErrorEvent(FLastErrorResponse);
        }
    }
catch (const Exception &E)
    {
    ShowException(&E, nullptr); //this do the trick but I don't know if it is the right thing to do
    }
}

Print this item

  Passing Delphi variables to Javascript function.
Posted by: thiagorod - 09-01-2020, 06:48 PM - Forum: IntraWeb General Discussion - Replies (4)

Hello,

I have this Javascript function (charting library) that takes an array of values as a variable, like this:

data: [22,61,64,35,91,59,62,91,124,94,77,196,309,147,102,107,199,36,0,0,0,0,0,0],

My doubt is how to make it read a Delphi array as the data input, I mean, how to transfer the values to this JS array.
Sorry if this is simple to do.

Regards,

Print this item

  java script errors
Posted by: joel - 08-30-2020, 02:04 AM - Forum: IntraWeb General Discussion - Replies (3)

Environment.  Iw15.2.15, cgdevtools. 4.1.0.257

I have upgraded to iw15.2.15 and the access violations have disappeared; however, I am still having some issues with the pages locking up because of Javascript errors.    I tried setting RednderAsyncEnabled := False, but that did not make any difference.

Here are the errors

1.

(index):102 Uncaught TypeError: Cannot read property 'selection' of undefined
    at HTMLDocument.<anonymous> ((index):102)
    at i (IWLib__1837908247.js:2)
    at Object.fireWith [as resolveWith] (IWLib__1837908247.js:2)
    at Function.ready (IWLib__1837908247.js:2)
    at HTMLDocument.K (IWLib__1837908247.js:2)

2.

IWBase__870463085.js:2 Error in SendRequest(): Cannot read property 'cloneNode' of undefined
consoleError @ IWBase__870463085.js:2
SendRequest @ IWBase__870463085.js:6
executeAjaxEvent @ IWBase__870463085.js:6
(anonymous) @ (index):59
dispatch @ IWLib__1837908247.js:3
r.handle @ IWLib__1837908247.js:3


The 2nd error "the send request error" is triggered when I click the cgdevtools button.

(08-30-2020, 02:04 AM)joel Wrote: Environment.  Iw15.2.15, cgdevtools. 4.1.0.257

I have upgraded to iw15.2.15 and the access violations have disappeared; however, I am still having some issues with the pages locking up because of Javascript errors.    I tried setting RednderAsyncEnabled := False, but that did not make any difference.

Here are the errors

1.

(index):102 Uncaught TypeError: Cannot read property 'selection' of undefined
    at HTMLDocument.<anonymous> ((index):102)
    at i (IWLib__1837908247.js:2)
    at Object.fireWith [as resolveWith] (IWLib__1837908247.js:2)
    at Function.ready (IWLib__1837908247.js:2)
    at HTMLDocument.K (IWLib__1837908247.js:2)

2.

IWBase__870463085.js:2 Error in SendRequest(): Cannot read property 'cloneNode' of undefined
consoleError @ IWBase__870463085.js:2
SendRequest @ IWBase__870463085.js:6
executeAjaxEvent @ IWBase__870463085.js:6
(anonymous) @ (index):59
dispatch @ IWLib__1837908247.js:3
r.handle @ IWLib__1837908247.js:3

The 2nd error "the send request error" is triggered when I click the cgdevtools button.

I did change out the button to just an IWButton and when I tried that I get the following error.

IWBase__870463085.js:2 Error in SendRequest(): Cannot read property 'cloneNode' of undefined
consoleError @ IWBase__870463085.js:2
SendRequest @ IWBase__870463085.js:6
(anonymous) @ IWBase__870463085.js:6
setTimeout (async)
executeAjaxEvent @ IWBase__870463085.js:6
processAjaxEvent @ IWBase__870463085.js:6
IWCL_DoOnClick @ IWBase__870463085.js:5
IWEventHandler @ IWBase__870463085.js:4

Print this item