Re: [twsocket] Problem with HTTPS

2009-05-04 Thread Arno Garrels
Fernando Gomes wrote:
>> After the HttpsCli.Post I get the following error: SSL requires a
>> context object.

You have to assign property SslContext.
HttpsCli.SslContext := SslContext;

--
Arno Garrels


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Problem with HTTPS

2009-05-04 Thread Fernando Gomes

Anyone ?? 
 
> From: fcgome...@msn.com
> To: twsocket@elists.org
> Date: Mon, 4 May 2009 19:20:03 +
> Subject: [twsocket] FW: Problem with HTTPS
> 
> 
> 
> 
> I'm having trouble doing my Delphi application using the HTTPS protocol. 
> 
> Below is a piece of code I'm using:
> 
> IniFile := TIniFile.Create('.\wrclnbi.ini');
> 
> SslContext := TSslContext.Create(SslContext);
> SslContext.InitContext;
> 
> HttpsCli := TSslHttpCli.Create(HttpsCli);
> HttpsCli.URL := Trim(IniFile.ReadString('URL', 'BaseHttps', ''));
> HttpsCli.Proxy := '';
> HttpsCli.NoCache := True;
> HttpsCli.Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
> application/x-shockwave-flash, */*';
> HttpsCli.AcceptLanguage := 'en-us';
> HttpsCli.ContentTypePost := 'application/x-www-form-urlencoded';
> HttpsCli.Agent := 'Eversystems/1.0 (compatible; MSIE 6.0; Windows NT 5.1; 
> SV1)';
> HttpsCli.Connection := 'keep-alive';
> HttpsCli.Cookie := 'JSESSIONID=' + Trim(IniFile.ReadString('Cookies', 
> 'JSESSIONID', ''));
> HttpsCli.SendStream := TMemoryStream.Create;
> HttpsCli.SendStream.Write(Data[1], Length(Data));
> HttpsCli.SendStream.Seek(0, 0);
> HttpsCli.RcvdStream := TMemoryStream.Create;
> 
> HttpsCli.Post;
> 
> After the HttpsCli.Post I get the following error: SSL requires a context 
> object.
> 
> I will be grateful if you could help me. 
> 
> Thank you very much.
> 
> Fernando de Carvalho Gomes
> São Paulo - Brazil.
> _
> Conheça os novos produtos Windows Live! Clique aqui.
> http://www.windowslive.com.br
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be

_
Deixe suas conversas mais divertidas. Baixe agora mesmo novos emoticons. É 
grátis!
http://specials.br.msn.com/ilovemessenger/pacotes.aspx
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] webpage image source

2009-05-04 Thread Xxxx Xxxx
Ok, this is exactly what I did per your advice:

procedure TForm1.HttpCli1MainLocationChange(Sender: TObject);
var
HttpCli: THttpCli;
begin
HttpCli := Sender as THttpCli;
HttpCli.RcvdStream.Destroy;
HttpCli.RcvdStream := TMemoryStream.Create;
end;

Same problem still. Google.com still results in an invalid image
(logo.gif).


<-Original Message-> 
>From: Francois PIETTE [francois.pie...@skynet.be]
>Sent: 5/4/2009 1:42:50 PM
>To: twsocket@elists.org
>Subject: Re: [twsocket] webpage image source
>
>>I tried HttpCli1.RcvdStream := nil in OnLocationChange but the images
>> are still invalid.
>
>This doesn't remove content from RcvdStream, it just disable access by
the 
>component. You should instead clear the content (it depends on the type
of 
>stream you are using. You may also destroy and recreate it).
>
>--
>francois.pie...@overbyte.be
>The author of the freeware multi-tier middleware MidWare
>The author of the freeware Internet Component Suite (ICS)
>http://www.overbyte.be
>
>
>- Original Message - 
>From: "Xxxx Xxxx" 
>To: 
>Sent: Monday, May 04, 2009 7:56 PM
>Subject: Re: [twsocket] webpage image source
>
>
>>I tried HttpCli1.RcvdStream := nil in OnLocationChange but the images
>> are still invalid.
>> Any other ideas?
>>
>>
>> <-Original Message->
>>>From: Francois PIETTE [francois.pie...@skynet.be]
>>>Sent: 5/3/2009 2:08:43 PM
>>>To: twsocket@elists.org
>>>Subject: Re: [twsocket] webpage image source
>>>
>>>Probably the datastream contains data from the not relocated URL as
>> well as
>>>the image from the relocated url. Use OnLocationChange to clear the
>>>datastream.
>>>
>>>--
>>>francois.pie...@overbyte.be
>>>The author of the freeware multi-tier middleware MidWare
>>>The author of the freeware Internet Component Suite (ICS)
>>>http://www.overbyte.be
>>>
>>>- Original Message - 
>>>From: "Xxxx Xxxx" 
>>>To: 
>>>Sent: Sunday, May 03, 2009 8:37 PM
>>>Subject: Re: [twsocket] webpage image source
>>>
>>>
 This is what I thought also, but I have FollowRelocation set to
True
>> and
 it still downloads these images as invalid - like in the
>> 'firebug.gif'
 example. There is data there, but the image won't display.


 <-Original Message->
>From: Francois PIETTE [francois.pie...@skynet.be]
>Sent: 5/3/2009 8:45:14 AM
>To: twsocket@elists.org
>Subject: Re: [twsocket] webpage image source
>
>> One more question: when I try to retrieve some images using the
 appended
>> "www.", the image does not download, but when I omit the
>"www.", it
>> downloads correctly.
>> Try doing a GET request for
>"notepad.com/images/firebug.gif" and it
>> works. Try "www.notepad.com/images/firebug.gif" and it does
>not.
>> Either way will work in my web browser, but with HttpCli it
>only
 works
>> without "www."
>
>Actually it works if you allow HttpCli to follow relocation.
>The real location for the image is without "www", but the server
>do a
>relocation if you prepend "www". Your browser automatically follow
>relocation.
>
>Use HttpTst sample program to play with that url.
>
>> Is it possible to determine which format to use with HttpCli
>> besides
>> doing a HEAD every time?
>
>I don't understand what you mean.
>HttpCli doesn't care about data format. It is just a HTTP transport
 layer,
>whatever data is transported.
>
>--
>francois.pie...@overbyte.be
>The author of the freeware multi-tier middleware MidWare
>The author of the freeware Internet Component Suite (ICS)
>http://www.overbyte.be
>
>-- 
>To unsubscribe or change your settings for TWSocket mailing list
>please goto
>http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>Visit our website at http://www.overbyte.be
>.
>


 >>size="2"

>>>style="font-size:13.5px">
__
>> _Get
>>>
 the Free email that has everyone talking at >>> href=http://www.mail2world.com
 target=new>http://www.mail2world.com >>> color=#99>Unlimited Email Storage - POP3 - Calendar -
 SMS - Translator - Much More!
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto
http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
>>>
>>>-- 
>>>To unsubscribe or change your settings for TWSocket mailing list
>>>please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>>>Visit our website at http://www.overbyte.be
>>>.
>>>
>>
>>
>> size="2" 
>>
>style="font-size:13.5px">__
_Get
>
>> the Free email that has everyone talking at > href=http://www.mail2world.com 
>> target=new>http://www.mail2world.com > color=#99>Unlimited Email Storage - POP3 - Calendar - 
>> SMS - Translator - Much More!
>> -- 
>> To unsubscribe or change yo

[twsocket] FW: Problem with HTTPS

2009-05-04 Thread Fernando Gomes



I'm having trouble doing my Delphi application using the HTTPS protocol. 

Below is a piece of code I'm using:
 
IniFile := TIniFile.Create('.\wrclnbi.ini');

SslContext := TSslContext.Create(SslContext);
SslContext.InitContext;

HttpsCli := TSslHttpCli.Create(HttpsCli);
HttpsCli.URL := Trim(IniFile.ReadString('URL', 'BaseHttps', ''));
HttpsCli.Proxy := '';
HttpsCli.NoCache := True;
HttpsCli.Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
application/x-shockwave-flash, */*';
HttpsCli.AcceptLanguage := 'en-us';
HttpsCli.ContentTypePost := 'application/x-www-form-urlencoded';
HttpsCli.Agent := 'Eversystems/1.0 (compatible; MSIE 6.0; Windows NT 5.1; 
SV1)';
HttpsCli.Connection := 'keep-alive';
HttpsCli.Cookie := 'JSESSIONID=' + Trim(IniFile.ReadString('Cookies', 
'JSESSIONID', ''));
HttpsCli.SendStream := TMemoryStream.Create;
HttpsCli.SendStream.Write(Data[1], Length(Data));
HttpsCli.SendStream.Seek(0, 0);
HttpsCli.RcvdStream := TMemoryStream.Create;

HttpsCli.Post;
 
After the HttpsCli.Post I get the following error: SSL requires a context 
object.
 
I will be grateful if you could help me. 

Thank you very much.
 
Fernando de Carvalho Gomes
São Paulo - Brazil.
_
Conheça os novos produtos Windows Live! Clique aqui.
http://www.windowslive.com.br
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] webpage image source

2009-05-04 Thread Francois PIETTE
>I tried HttpCli1.RcvdStream := nil in OnLocationChange but the images
> are still invalid.

This doesn't remove content from RcvdStream, it just disable access by the 
component. You should instead clear the content (it depends on the type of 
stream you are using. You may also destroy and recreate it).

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


- Original Message - 
From: "Xxxx Xxxx" 
To: 
Sent: Monday, May 04, 2009 7:56 PM
Subject: Re: [twsocket] webpage image source


>I tried HttpCli1.RcvdStream := nil in OnLocationChange but the images
> are still invalid.
> Any other ideas?
>
>
> <-Original Message->
>>From: Francois PIETTE [francois.pie...@skynet.be]
>>Sent: 5/3/2009 2:08:43 PM
>>To: twsocket@elists.org
>>Subject: Re: [twsocket] webpage image source
>>
>>Probably the datastream contains data from the not relocated URL as
> well as
>>the image from the relocated url. Use OnLocationChange to clear the
>>datastream.
>>
>>--
>>francois.pie...@overbyte.be
>>The author of the freeware multi-tier middleware MidWare
>>The author of the freeware Internet Component Suite (ICS)
>>http://www.overbyte.be
>>
>>- Original Message - 
>>From: "Xxxx Xxxx" 
>>To: 
>>Sent: Sunday, May 03, 2009 8:37 PM
>>Subject: Re: [twsocket] webpage image source
>>
>>
>>> This is what I thought also, but I have FollowRelocation set to True
> and
>>> it still downloads these images as invalid - like in the
> 'firebug.gif'
>>> example. There is data there, but the image won't display.
>>>
>>>
>>> <-Original Message->
From: Francois PIETTE [francois.pie...@skynet.be]
Sent: 5/3/2009 8:45:14 AM
To: twsocket@elists.org
Subject: Re: [twsocket] webpage image source

> One more question: when I try to retrieve some images using the
>>> appended
> "www.", the image does not download, but when I omit the "www.", it
> downloads correctly.
> Try doing a GET request for "notepad.com/images/firebug.gif" and it
> works. Try "www.notepad.com/images/firebug.gif" and it does not.
> Either way will work in my web browser, but with HttpCli it only
>>> works
> without "www."

Actually it works if you allow HttpCli to follow relocation.
The real location for the image is without "www", but the server do a
relocation if you prepend "www". Your browser automatically follow
relocation.

Use HttpTst sample program to play with that url.

> Is it possible to determine which format to use with HttpCli
> besides
> doing a HEAD every time?

I don't understand what you mean.
HttpCli doesn't care about data format. It is just a HTTP transport
>>> layer,
whatever data is transported.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
.

>>>
>>>
>>> >size="2"
>>>
>>style="font-size:13.5px">__
> _Get
>>
>>> the Free email that has everyone talking at >> href=http://www.mail2world.com
>>> target=new>http://www.mail2world.com >> color=#99>Unlimited Email Storage - POP3 - Calendar -
>>> SMS - Translator - Much More!
>>> -- 
>>> To unsubscribe or change your settings for TWSocket mailing list
>>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>>> Visit our website at http://www.overbyte.be
>>
>>-- 
>>To unsubscribe or change your settings for TWSocket mailing list
>>please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>>Visit our website at http://www.overbyte.be
>>.
>>
>
>
>  style="font-size:13.5px">___Get
>  
> the Free email that has everyone talking at  href=http://www.mail2world.com 
> target=new>http://www.mail2world.com   color=#99>Unlimited Email Storage – POP3 – Calendar – 
> SMS – Translator – Much More!
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] webpage image source

2009-05-04 Thread Xxxx Xxxx
I tried HttpCli1.RcvdStream := nil in OnLocationChange but the images
are still invalid.
Any other ideas?


<-Original Message-> 
>From: Francois PIETTE [francois.pie...@skynet.be]
>Sent: 5/3/2009 2:08:43 PM
>To: twsocket@elists.org
>Subject: Re: [twsocket] webpage image source
>
>Probably the datastream contains data from the not relocated URL as
well as 
>the image from the relocated url. Use OnLocationChange to clear the 
>datastream.
>
>--
>francois.pie...@overbyte.be
>The author of the freeware multi-tier middleware MidWare
>The author of the freeware Internet Component Suite (ICS)
>http://www.overbyte.be
>
>- Original Message - 
>From: "Xxxx Xxxx" 
>To: 
>Sent: Sunday, May 03, 2009 8:37 PM
>Subject: Re: [twsocket] webpage image source
>
>
>> This is what I thought also, but I have FollowRelocation set to True
and
>> it still downloads these images as invalid - like in the
'firebug.gif'
>> example. There is data there, but the image won't display.
>>
>>
>> <-Original Message->
>>>From: Francois PIETTE [francois.pie...@skynet.be]
>>>Sent: 5/3/2009 8:45:14 AM
>>>To: twsocket@elists.org
>>>Subject: Re: [twsocket] webpage image source
>>>
 One more question: when I try to retrieve some images using the
>> appended
 "www.", the image does not download, but when I omit the "www.", it
 downloads correctly.
 Try doing a GET request for "notepad.com/images/firebug.gif" and it
 works. Try "www.notepad.com/images/firebug.gif" and it does not.
 Either way will work in my web browser, but with HttpCli it only
>> works
 without "www."
>>>
>>>Actually it works if you allow HttpCli to follow relocation.
>>>The real location for the image is without "www", but the server do a
>>>relocation if you prepend "www". Your browser automatically follow
>>>relocation.
>>>
>>>Use HttpTst sample program to play with that url.
>>>
 Is it possible to determine which format to use with HttpCli
besides
 doing a HEAD every time?
>>>
>>>I don't understand what you mean.
>>>HttpCli doesn't care about data format. It is just a HTTP transport
>> layer,
>>>whatever data is transported.
>>>
>>>--
>>>francois.pie...@overbyte.be
>>>The author of the freeware multi-tier middleware MidWare
>>>The author of the freeware Internet Component Suite (ICS)
>>>http://www.overbyte.be
>>>
>>>-- 
>>>To unsubscribe or change your settings for TWSocket mailing list
>>>please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>>>Visit our website at http://www.overbyte.be
>>>.
>>>
>>
>>
>> size="2" 
>>
>style="font-size:13.5px">__
_Get
>
>> the Free email that has everyone talking at > href=http://www.mail2world.com 
>> target=new>http://www.mail2world.com > color=#99>Unlimited Email Storage - POP3 - Calendar - 
>> SMS - Translator - Much More!
>> -- 
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be 
>
>-- 
>To unsubscribe or change your settings for TWSocket mailing list
>please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>Visit our website at http://www.overbyte.be
>.
> 


___Get
 the Free email that has everyone talking at http://www.mail2world.com 
target=new>http://www.mail2world.com  Unlimited 
Email Storage – POP3 – Calendar – SMS – Translator – 
Much More!
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] OT: WM_USER or WM_APP

2009-05-04 Thread Wilfried Mestdagh
Hello Paul,

use starting from WM_USER.
You don't have to worry because you send / post messages to specific
windows, so the right window will receive it.

WM_USER = 0x400
WM_APP  = 0x8000

Windows help say:
Message numbers in the second range (WM_USER through 0x7FFF) can be
defined and used by an application to send messages within a private
window class.

Message numbers in the third range (0x8000 through 0xBFFF) are reserved
for future use by Windows.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Sunday, May 3, 2009, 21:46, Paul wrote:

> They start at WM_USER + 1.
> So there can be a conflict.
> I think I better switch to WM_APP then

> Paul

> - Original Message - 
> From: "Arno Garrels" 
> To: "ICS support mailing" 
> Sent: Sunday, May 03, 2009 9:26 PM
> Subject: Re: [twsocket] OT: WM_USER or WM_APP


>> Arno Garrels wrote:
>>> ID. You hopefully do not post/send common messages (not registered
>>> by AllocateMsgHandlers) to the ICS window in V6 and better.
>> 
>> Sorry, when I said "common", I meant "custom" message IDs, in the range
>> ICS V6 and better might allocate for own purposes (search for 
>> GWndHandlerMsgLow in OverbyteIcsWndControl.pas, there are comments). 
>> It's no problem to post/send Windows messages such as WM_QUIT etc..
>> 
>> --
>> Arno Garrels
>> 
>> 
>> -- 
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be
>>

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be