AGB  ·  Datenschutz  ·  Impressum  







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

fill pointer in DLL from app

Ein Thema von mohfa · begonnen am 4. Jun 2008 · letzter Beitrag vom 4. Jun 2008
Antwort Antwort
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#1

fill pointer in DLL from app

  Alt 4. Jun 2008, 04:17
How to pass the parameter to DLL, the parameter is a pointer to the record .
in my Dll i have :

Delphi-Quellcode:
type
  PList = ^AList;
  AList = record
  nam:String;
  Orders: TList;
  end;
so how could i fill this parameter from my app;

regards
  Mit Zitat antworten Zitat
Benutzerbild von SirThornberry
SirThornberry
(Moderator)

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

Re: fill pointer in DLL from app

  Alt 4. Jun 2008, 06:57
you have to work with sharemem because in your record are objects and dynamic strings.
Then you have to call your function in your dll like any other function.
But I wunder. You use a record and a TList object. So you mix global programming with oop. why don't you use only one of both?
Jens
Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
  Mit Zitat antworten Zitat
Muetze1
(Gast)

n/a Beiträge
 
#3

Re: fill pointer in DLL from app

  Alt 4. Jun 2008, 12:38
With the use of sharemem or fastmm you can pass the string from the app to the dll, but an object instance (simple VCL objects) will not work correctly.
  Mit Zitat antworten Zitat
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: fill pointer in DLL from app

  Alt 4. Jun 2008, 19:36
thank SirThornberry , but is there any other alternative so that i can use Strings in my Dll without using ShareMem unit .

Because when using ShareMem i think my Dll will be used only by My app .
  Mit Zitat antworten Zitat
Muetze1
(Gast)

n/a Beiträge
 
#5

Re: fill pointer in DLL from app

  Alt 4. Jun 2008, 20:55
use PChar as type for strings and do it like the WinAPI: the caller has to allocate the memory for results and the DLL fills the memory of the app - or returns the needed space, if the allocation is is too small.
  Mit Zitat antworten Zitat
Antwort Antwort


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 14:49 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz