Re: [twsocket] DLL implementation advice (or example)...

2011-09-16 Thread Arno Garrels
Adam Burgoyne wrote: I've now changed the code to this which should solve the problem if I understood correctly: function ReadMessage: PAnsiChar; stdcall; var Note: AnsiString; begin EnterCriticalSection(CritSectn); if (NotesList.Count 0) then begin Note :=

[twsocket] Undeclared identifier: 'TSslWSocket'

2011-09-16 Thread Daniel Legrand
Hi, I have just switched to DelphiXE and started to build my first project with ICS SSL Components. I can't run my project because it keeps giving me the following error, [DCC Error] Unit1.pas(16): E2003 Undeclared identifier: 'TSslWSocket' My project got nothing in it, it is just a test for

Re: [twsocket] Undeclared identifier: 'TSslWSocket'

2011-09-16 Thread Francois PIETTE
Add USE_SSL in the conditional defines for your project options. -- 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 -Message d'origine- From: Daniel Legrand Sent:

Re: [twsocket] Undeclared identifier: 'TSslWSocket'

2011-09-16 Thread daniel legrand
Thanks! That did the trick. -- From: Francois PIETTE francois.pie...@skynet.be Sent: Friday, September 16, 2011 2:08 PM To: ICS support mailing twsocket@elists.org Subject: Re: [twsocket] Undeclared identifier: 'TSslWSocket' Add USE_SSL in the

Re: [twsocket] DLL implementation advice (or example)...

2011-09-16 Thread Adam Burgoyne
Thanks for the explanation and example, Arno, but I was 1 step ahead of you in realising the mistake. What I did (which appears to have worked as the errors are not being reported now) is to simply move the Note variable into the global scope. The DLL only gets called by one external process so

Re: [twsocket] DLL implementation advice (or example)...

2011-09-16 Thread Arno Garrels
Adam Burgoyne wrote: Thanks for the explanation and example, Arno, but I was 1 step ahead of you in realising the mistake. What I did (which appears to have worked as the errors are not being reported now) is to simply move the Note variable into the global scope. The DLL only gets

Re: [twsocket] DLL implementation advice (or example)...

2011-09-16 Thread RTT
I think you could also use a WideString var parameter. function ReadMessage(var msg:WideString):boolean; stdcall; var Note: AnsiString; begin EnterCriticalSection(CritSectn); if (NotesList.Count 0) then begin msg := NotesList.Strings[0]; NotesList.Delete(0); Result := true; end

Re: [twsocket] DLL implementation advice (or example)...

2011-09-16 Thread Arno Garrels
RTT wrote: I think you could also use a WideString var parameter. That would work which plain text, but it's slow.. I bet it's slower than one more copy of the result string. Also using WideString leads to implicit string casts, without any warning in Delphi versions 2009, which is

Re: [twsocket] DLL implementation advice (or example)...

2011-09-16 Thread RTT
On 16-09-2011 18:58, Arno Garrels wrote: That would work which plain text Why your reference to plaint text? A WideString can carry any data, or I'm missing something? And WideStrings are now relatively fast, in Vista and 7, if compared to XP. But I really don't know if two calls, one to get

Re: [twsocket] DLL implementation advice (or example)...

2011-09-16 Thread Arno Garrels
RTT wrote: On 16-09-2011 18:58, Arno Garrels wrote: That would work which plain text Why your reference to plaint text? A WideString can carry any data, or I'm missing something? As far as I read this thread the OP uses a non-Unicode Delphi version. So string maps to AnsiString. Any

Re: [twsocket] DLL implementation advice (or example)...

2011-09-16 Thread RTT
On 16-09-2011 20:20, Arno Garrels wrote: As far as I read this thread the OP uses a non-Unicode Delphi version. So string maps to AnsiString. Any assignment of an AnsiString to a WideString leads to an implicit string cast to Unicode (Win API WideCharToMultiByte) internally, that's one of the