Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Strings von (C)-DLL ? (https://www.delphipraxis.net/125953-strings-von-c-dll.html)

ralfiii 15. Dez 2008 16:24


Strings von (C)-DLL ?
 
Hallo!

Ich hab hier eine DLL mit einer Methode die folgendermassen deklariert ist:

Delphi-Quellcode:
 typedef short   (__stdcall *LPFUNCMTRequestMTHolterRec)   (wchar_t parmCmpFName[MAX_PATH],
   wchar_t parmVoicFName[MAX_PATH],
   short *VoiceRetcode,
 ...
Übersetzt hab' ich's jetzt mal so:

Delphi-Quellcode:
function MTRequestMTHolterRec(const CmpFName,
  VoicFName : WideChar;
  var VoiceRetcode : SmallInt;
 ...
Wie ruf ich die auf?
Ich muss ja vorher für die Rückübergabe der WideChars Platz reservieren.
Aber wie?

Das lässt sich mal nicht compilieren:
Delphi-Quellcode:
var CmpFName : WideChar;
     setlength(CmpFName, MtMaxPath);
Danke,
Ralf

DeddyH 15. Dez 2008 16:38

Re: Strings von (C)-DLL ?
 
Nicht, dass ich Ahnung davon hätte, aber sind die Parameter nicht in der Größe vorgegeben (array[0..MAX_PATH - 1] of WideChar)?

nicodex 15. Dez 2008 16:38

Re: Strings von (C)-DLL ?
 
Zitat:

Zitat von ralfiii
Delphi-Quellcode:
 typedef short   (__stdcall *LPFUNCMTRequestMTHolterRec)   (wchar_t parmCmpFName[MAX_PATH],
   wchar_t parmVoicFName[MAX_PATH],
   short *VoiceRetcode,
 ...

Delphi-Quellcode:
type
  LPFUNCMTRequestMTHolterRec = function(parmCmpFName, parmVoicFName: PWideChar; var VoiceRetcode: SmallInt; ...): SmallInt; stdcall;


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:31 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