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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 98,089
» Latest member: kp88tips1
» Forum threads: 2,426
» Forum posts: 11,371

Full Statistics

Online Users
There are currently 1865 online users.
» 1 Member(s) | 1861 Guest(s)
Applebot, Bing, Google, kp88tips1

Latest Threads
WebApplication.IP change ...
Forum: IntraWeb General Discussion
Last Post: MJS@mjs.us
09-11-2026, 09:49 PM
» Replies: 1
» Views: 184
Hook/callback to handle t...
Forum: IntraWeb General Discussion
Last Post: Lenfors
09-08-2026, 09:03 AM
» Replies: 0
» Views: 150
Reproducible IIS crash in...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
09-08-2026, 01:48 AM
» Replies: 0
» Views: 165
The packages IW16.xx inc...
Forum: IntraWeb General Discussion
Last Post: hsbelli
09-03-2026, 11:46 AM
» Replies: 2
» Views: 469
Redirection issues with F...
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 10:03 AM
» Replies: 0
» Views: 237
Source Code
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 08:11 AM
» Replies: 3
» Views: 640
TContenthandler requires ...
Forum: IntraWeb General Discussion
Last Post: valmeras
08-30-2026, 02:35 AM
» Replies: 0
» Views: 224
TIWjQDBGrid erratic behav...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
08-20-2026, 05:12 PM
» Replies: 8
» Views: 2,239
Change Language DataTable
Forum: IntraWeb General Discussion
Last Post: Rigoberto Mercedes
08-19-2026, 03:21 PM
» Replies: 1
» Views: 357
How to terminate HTTP Thr...
Forum: Indy
Last Post: rlebeau
08-14-2026, 08:01 AM
» Replies: 5
» Views: 984

 
  Using C++Builder to access columns of TIWDBGrid
Posted by: Ibouka - 12-20-2022, 06:59 PM - Forum: IntraWeb General Discussion - Replies (3)

Hi!
I followed this Delphi sample for accessing columns of a TIWDBGrid using C++Builder, but it does not work. 
Below is my code:

Code:
__fastcall TForm1::TForm1(TComponent* Owner) : TFrame(Owner)
{//
 TRESTClient *REST1Client = new TRESTClient(this);
 TRESTRequest *REST1Request = new TRESTRequest(this);
 TRESTResponse *REST1Response = new TRESTResponse(this);
 TClientDataSet *ClientDataSet1 = new TClientDataSet(this);
 TRESTResponseDataSetAdapter *REST1ResponseDataSetAdapter = new TRESTResponseDataSetAdapter(this);

 ClientDataSet1->AfterOpen = &ClientDataSet1AfterOpen;

 REST1Client->BaseURL = "my.URL.php";
 REST1Request->Client = REST1Client;
 REST1Request->Response = REST1Response;
 REST1Response->ContentType = "application/json";
 REST1ResponseDataSetAdapter->Dataset = ClientDataSet1;
 REST1ResponseDataSetAdapter->Response = REST1Response;
 REST1ResponseDataSetAdapter->Active = true;
 REST1Request->Execute();

 TDataSource *DataSource1 = new TDataSource(this);
 DataSource1->DataSet = ClientDataSet1;
 IWDBGrid1->DataSource = DataSource1;

// dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[0])->Width = (IWDBGrid1->Width/20) * 02; // => Argument out of range
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ClientDataSet1AfterOpen(TDataSet *DataSet)
{//
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[0])->Width = (IWDBGrid1->Width/10) * 2; // => Argument out of range
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[1])->Width = (IWDBGrid1->Width/10) * 1;
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[2])->Width = (IWDBGrid1->Width/10) * 4;
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[3])->Width = (IWDBGrid1->Width/10) * 3;

 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[0])->Title->Text = "AFirstTitle";
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[1])->Title->Text = "ASecondTitle";
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[2])->Title->Text = "AThirdTitle";
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[3])->Title->Text = "AFourthTitle";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::IWDBGrid1Render(TObject *Sender)
{//
 // dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[0])->Width = (IWDBGrid1->Width/10) * 2; // => Argument out of range
}
//---------------------------------------------------------------------------

I am having the error message "Argument out of range" beginning from the first line and for each line.
Any idea of how to get rid of this error?

Print this item

  IntraWeb 15.2.69 is out!
Posted by: Alexandre Machado - 12-18-2022, 10:26 PM - Forum: IntraWeb General Discussion - Replies (6)

Hi guys,

there is a new update available: https://www.atozed.com/2022/12/intraweb-15-2-69/

I strongly recommend this one because it contains some critical bug fixes (also some interesting new features)

Enjoy!  Big Grin

Print this item

  Upload media to WhatsApp cloud API
Posted by: Lior I - 12-18-2022, 10:24 AM - Forum: Indy - Replies (3)

I need to upload a PDF file to a WhatsApp Cloud API.
Can someone help me translate this WhatsApp curl example code to Delphi pascal?
Here is the code from the WhatsApp documentation (JPEG example):

Code:
curl -X POST \
  'https://graph.facebook.com/v15.0/FROM_PHONE_NUMBER_ID/media' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -F 'file=@/local/path/file.jpg;type=image/jpeg'
  -F 'messaging_product=whatsapp'

I don't know how to translate the file parameter. It includes both path and file type attributes.
Code:
-F 'file=@/local/path/file.jpg;type=image/jpeg' 


I use Delphi RIO 10.3
Thanks in advance

Print this item

  TIdTCPServer with SSL TLS?
Posted by: 3ddark - 12-16-2022, 01:45 PM - Forum: Indy - No Replies

Can someone share a sample code that works with TIdTCPServer with SSL TLS?

Why is it so complicated or difficult? Probably I don't understand. There is a lot of different information on the internet. But I haven't seen any information that is completely correct. It could be an example reference code.

Below is the code I wrote (which I don't understand). Please someone explain to me what is missing, wrong or excessive.

1-How do I create Self-Signed SSL with OpenSSL?
2-How do I install these certificates on the server side?
3-Can I connect with the same (with Server) SSL settings for the client?

Also, after I test these codes in windows environment, I will run them under Linux.

Code:
procedure TServer.InitTCPConnection;
begin
  IdTCPServer := TIdTCPServer.Create;

  if FConfig.UseSSL then
  begin
    IdServerIOHandlerSSLOpenSSL := TIdServerIOHandlerSSLOpenSSL.Create;

    IdServerIOHandlerSSLOpenSSL.OnGetPassword := SSLIOHandlerSocketOpenSSLGetPassword;

    IdServerIOHandlerSSLOpenSSL.SSLOptions.CertFile := 'whichfile_pem_key_crt';
    IdServerIOHandlerSSLOpenSSL.SSLOptions.KeyFile := 'whichfile_pem_key_crt';
    IdServerIOHandlerSSLOpenSSL.SSLOptions.RootCertFile := 'whichfile_pem_key_crt';
    IdServerIOHandlerSSLOpenSSL.SSLOptions.Mode := sslmUnassigned;
    IdServerIOHandlerSSLOpenSSL.SSLOptions.VerifyMode := [];
    IdServerIOHandlerSSLOpenSSL.SSLOptions.VerifyDepth := 0;
    IdServerIOHandlerSSLOpenSSL.sslOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
  end;

  IdTCPServer.Active := False;
  IdTCPServer.MaxConnections := FConfig.MaxConnection;
  IdTCPServer.ListenQueue := 1500;
  IdTCPServer.TerminateWaitTime := 120000;
  IdTCPServer.UseNagle := False;
  IdTCPServer.ReuseSocket := rsFalse;

  if FConfig.UseSSL then
    IdTCPServer.IOHandler := IdServerIOHandlerSSLOpenSSL;

  IdTCPServer.OnConnect := IdTCPServerConnect;
  IdTCPServer.OnDisconnect := IdTCPServerDisconnect;
  IdTCPServer.OnExecute := IdTCPServerExecute;

  IdTCPServer.Bindings.Clear;
  IdTCPServer.Bindings.Add.Port := FConfig.CloudPort;
  IdTCPServer.Bindings.DefaultPort := FConfig.CloudPort;
end;

procedure TServer.IdTCPServerConnect(AContext: TIdContext);
begin
  Writeln('Wellcome :) ' + AContext.Binding.PeerIP + ' ' + AContext.Binding.PeerPort.ToString);
  if (FConfig.UseSSL) and (AContext.Connection.IOHandler is TIdSSLIOHandlerSocketBase) then
    TIdSSLIOHandlerSocketBase(AContext.Connection.IOHandler).PassThrough := False;
end;

procedure TServer.IdTCPServerDisconnect(AContext: TIdContext);
begin
  if not Assigned(AContext) or (AContext = nil) then
    Exit;
  Writeln('Disconnect: ' + AContext.Binding.PeerIP + ':' + AContext.Binding.PeerPort.ToString + ' Good Bye');
end;

procedure TServer.IdTCPServerExecute(AContext: TIdContext);
var
  RCIdByte: TIdBytes;
begin
  AContext.Connection.IOHandler.DefStringEncoding := IndyTextEncoding_UTF8;
  AContext.Connection.IOHandler.ReadBytes(RCIdByte, -1);

  FLockList := IdTCPServer.Contexts.LockList;
  try
    //Some process
  finally
    IdTCPServer.Contexts.UnlockList;
  end;
end;

procedure TServer.SSLIOHandlerSocketOpenSSLGetPassword(var Password: string);
begin
  Password := 'qwerty';
end;


I also use the following commands to generate Self-Signed certificate for OpenSSL. Are these true?
Which files created here mean Certificate for me. A lot of files are created.
Code:
@echo off

rem Certificate Authority (CA)
openssl genrsa -passout pass:qwerty -out ca-secret.key 1024
openssl rsa -passin pass:qwerty -in ca-secret.key -out ca.key
openssl req -new -x509 -days 3650 -subj "/C=TR/ST=Turkey/L=Istanbul/O=Example root CA/OU=Example CA unit/CN=example.com" -key ca.key -out ca.crt
openssl pkcs12 -export -passout pass:qwerty -inkey ca.key -in ca.crt -out ca.pfx
openssl pkcs12 -passin pass:qwerty -passout pass:qwerty -in ca.pfx -out ca.pem

rem SSL Server certificate
openssl genrsa -passout pass:qwerty -out server-secret.key 1024
openssl rsa -passin pass:qwerty -in server-secret.key -out server.key
openssl req -new -subj "/C=TR/ST=Turkey/L=Istanbul/O=Example server/OU=Example server unit/CN=server.example.com" -key server.key -out server.csr
openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt
openssl pkcs12 -export -passout pass:qwerty -inkey server.key -in server.crt -out server.pfx
openssl pkcs12 -passin pass:qwerty -passout pass:qwerty -in server.pfx -out server.pem

rem SSL Client certificate
openssl genrsa -passout pass:qwerty -out client-secret.key 1024
openssl rsa -passin pass:qwerty -in client-secret.key -out client.key
openssl req -new -subj "/C=TR/ST=Turkey/L=Istanbul/O=Example client/OU=Example client unit/CN=client.example.com" -key client.key -out client.csr
openssl x509 -req -days 3650 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out client.crt
openssl pkcs12 -export -passout pass:qwerty -inkey client.key -in client.crt -out client.pfx
openssl pkcs12 -passin pass:qwerty -passout pass:qwerty -in client.pfx -out client.pem

rem Diffie–Hellman (D-H) key exchange
openssl dhparam -out dh1024.pem 1024

Print this item

  Updating Chart.js script
Posted by: Xenogall - 12-15-2022, 04:00 PM - Forum: IntraWeb General Discussion - Replies (2)

I've got some chart.js data in a script inside my HTML file. I can replace part of the chart.js script with tags that I then process in the IWTemplateProcessorHTML's UnknownTag event. This works when I populate the script before the HTML page is loaded. Once the page is loaded, I'm struggling to find a way to force the chart to redraw, so I can inject new data into the chart using the UnknownTag event.

I've tried using WebApplication->CallBackResponse->AddJavaScriptToExecuteAsCDATA(js) to inject some JavaScript, but I don't know enough JS to work out how to get the chart to update.

I've also tried surrounding the chart with divs and giving the div the name of an IWRegion. I then call invalidate on the region, but this didn't work for me.

Any help would be very gratefully received. Thanks.

Richard

Print this item

  Webcam intraweb demo on Github
Posted by: Stéphane Aquilina - 12-15-2022, 08:52 AM - Forum: IntraWeb General Discussion - No Replies

Hi,
 
I try to use Webcam demo on GitHub.
 
I would like to save the picture in the the imgCam : TIWimage using TIWimage.Savetofile method but it’s not
possible.
 
Sorry but I don’t know how to do to realize this process [Image: cid:77F327BD82034FADB1BA3395CD4669CB@STEPH]
 
Is it possible to help me ?
 
Thank you and best regards
 
Stéphane Aquilina

Print this item

  local render files
Posted by: Alain.verdier - 12-13-2022, 08:03 AM - Forum: IntraWeb General Discussion - Replies (1)

Hello,

My web server is installed on a Robot which for security reasons cannot be connected to the web.
I used the “MultiSessionssNoCookie” example to display a data grid:
With web access

  /// <summary>
  /// Add the files for the grid
  /// </summary>
PageContext.AddLinkFile('https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css');
PageContext.AddScriptFile('https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js');
PageContext.AddToInitProc('$("#tbl1").DataTable();');

It works perfectly.

Locally, with files in:
/bin/wwwroot/css
/bin/wwwroot/js
  PageContext.AddLinkFile('/css/jquery.dataTable.min.css');
  PageContext.AddScriptFile('/js/jquery.dataTables.min.js');
  PageContext.AddToInitProc('$("#tbl1").DataTable();');
I have the following error
"class EIWinvalideRessourceException IW_JS_jquery.dataTables.min not found"

Thanks for your help
Alain    



Attached Files Thumbnail(s)
   
Print this item

  Unique Session
Posted by: elmabdel - 12-12-2022, 08:47 AM - Forum: IntraWeb General Discussion - Replies (1)

Hi Everyone,

I'm using Intraweb for 2 Years now, I found this software very useful for my projet.
I have a little problem when I'm trying to open my website from a link outside from Webbrowser (mailbox for exemple), That create always 2 sessions !
I try other examples from Github (ContentHandlersDemo or MultiPageApp) I have the same behavior ! 
How could we make to get only 1 session ?
Thanks for your help

Abdel

Print this item

  Forcing a refresh
Posted by: JimCater - 12-12-2022, 02:42 AM - Forum: IntraWeb General Discussion - Replies (4)

with Intraweb I have a timer which checks every minute to see if the data the user is viewing has changed and a page refresh is required. What code should I use to trigger the refresh. I understand that a component on the form can have its click event executed, but how is that done. I have seen some ideas about WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA but not sure how to use it. Help will be appreciated.

Print this item

  Windows Server 2022 HTTP.SYS
Posted by: PaulWeem - 12-07-2022, 09:45 AM - Forum: IntraWeb General Discussion - Replies (4)

Hi All,

I don't know if anyone has encountered the same challenges as I have, but here it goes.
After upgrading my webserver to Windows Server 2022, my Intraweb applications using TIWAppCache stopped working.

More details:
I create a new Tempfile with: LFileName := TIWAppCache.NewTempFileName('.pdf')
The App does it's thing and saves it's data to this new Tempfile
Finally I process the Tempfile with: HRef := TIWAppCache.AddFileToCache(WebApplication, LFileName, FContentType, ctSession)

But in one of the 2 final steps I get the error: Can't add file <TempFile> to cache. The file does not exist.

All this is done in HTTP.SYS.
When running the same app in SA, all works fine.

I've read about security issues and patches on Windows Server 2022 regarding HTTP.SYS, could it be that this mechanism is unsecure?

I'm using Delphi 11.1 with IW 15.2.68 Ultimate.

Thanks in advance for (possible) solutions!

Cheers, Paul

PS. After moving everything to a Windows 2019 Server, all worked well!

Print this item