AGB  ·  Datenschutz  ·  Impressum  







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

Class with strings in DLL

Ein Thema von WojTec · begonnen am 1. Jan 2011 · letzter Beitrag vom 7. Jan 2011
 
Benutzerbild von SirThornberry
SirThornberry
(Moderator)

Registriert seit: 23. Sep 2003
Ort: Bockwen
12.235 Beiträge
 
Delphi 2006 Professional
 
#10

AW: Class with strings in DLL

  Alt 7. Jan 2011, 17:08
If you use PChar and so you don't need Sharemem.
Zitat:
When I try use any function from it, raises AV
Do you have this Problem only if you have strings in your dll? I suppose you have source like this:
Delphi-Quellcode:
function GetString(): PChar;
var
  mystring: string;
begin
  mystring := 'hello world';
  result := myString;
end;
If you have such source code you will get an AV because PChar is only a Pointer (of a special type). But after leaving this funktion "mystring" is freed and so "result" points to freed memory.

It would be interesting if you get the AV during the call or later when you use the result.
Jens
Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
  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 00:17 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