Autor Beitrag
Peter18
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 489
Erhaltene Danke: 2


Delphi4
BeitragVerfasst: Mi 21.06.06 10:51 
Hallo Leute,

ich übertrage gerade ein VBA-Programm auf Delphi4. Dabei benutze ich die TAPI. Leider klappt es nicht mit der Parameterübergabe. Entweder ist der Pointer ungültig, oder es wird nur Datenmüll übergeben. Kann mir jemand einen Tipp geben??

Deklaration als PChar
Übergabe des String mit PChar(PascalString)
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Mi 21.06.06 11:10 
Ich kenn zwar TAPI nicht, aber eigentlich sollte es doch besser sein die Funtkionen selbst zu importieren. Ohne Quelltext kann man schonmal gar nicht helfen.

Aber deklarier mal den Text als String und bei der Parameterübergabe nimm dann PChar(Text).
Desweiteren brauchst du auch die richtige Aufrufkonvention, d.h. stdcall/register/cdecl.

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Peter18 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 489
Erhaltene Danke: 2


Delphi4
BeitragVerfasst: Do 22.06.06 11:22 
Hallo uall@ogc,

ich denke so habe ich es gemacht. Die Tapi wird auch angesprochen und startet eine Telefonanwendung. Dort kommt aber nur Datenmüll an.

Die Deklaration:

function tapiRequestMakeCall(lpszDestAddress : PChar; lpszAppName : PChar; lpszCalledParty : PChar; lpszComment : PChar) : Longint; external 'TAPI32.DLL';

Der Aufruf:

r := tapiRequestMakeCall( PChar(sDestAddress), PChar(sAppName), PChar(sName), PChar(sComment));
Einloggen, um Attachments anzusehen!
_________________
Grüße von Peter
Steve1024
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 141

Windows 2K, XP, 7 & Server 2003 - 2008; Linux (Ubuntu, Fedora)
D7, D05, D06, D09, DXE
BeitragVerfasst: Do 22.06.06 11:50 
Ich vermute, so wie das aussieht, dass du hiter der Funktion noch ein stdcall brauchst...

also:

ausblenden Delphi-Quelltext
1:
function tapiRequestMakeCall(lpszDestAddress : PChar; lpszAppName : PChar; lpszCalledParty : PChar; lpszComment : PChar) : Longint; stdcall; external 'TAPI32.DLL';					


Ich denke, das wars...
Peter18 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 489
Erhaltene Danke: 2


Delphi4
BeitragVerfasst: Do 22.06.06 12:06 
Hallo Steve1024,

Danke, das hat geholfen! Jetzt funktioniert es.

_________________
Grüße von Peter