AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

How to - string in DLL

Ein Thema von WojTec · begonnen am 16. Jun 2011 · letzter Beitrag vom 22. Jun 2011
 
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#18

Re: How to - string in DLL

  Alt 20. Jun 2011, 10:48
Oh gosh, I forgot add stdcall before external in app. Ah Now working! Thanks

Also a few of you told that better is using WideChar. I tried this:

Delphi-Quellcode:
// In DLL

function FooncUni(Data: WideString): WideString; stdcall;
var
  S: string;
begin
  S := 'foo' + Data;

  Result := S;
end;

// In app:

function FooncUni(Data: WideString): WideString; stdcall external 'StringDLL.dll';

Caption := FooncUni('bar'); // Caption is 'foobar'
and working without any problems (as normal string type in EXE, that's cool ). But early @himitsu told:

How to use the functions, they are required to something in this case?

Also another think: to use Ansii or Unicode I have to write 2 functions with PWideChar and PAnsiChar parameters? Or one lets say Unocode version and second to convert Unicode Buffer to Ansi - how? And WideString - it is always Unicode?
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:29 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz