 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
tarkan Guest
|
Posted: Thu Sep 09, 2004 11:50 am Post subject: Using ShortStrings in Visual C++ |
|
|
Hi,
I wrote an Interface in Delphi dll:(string type is treated like
shortstring type...)
IMyInterface = interface
['{EF676F51-FD54-4257-B4F5-37847656D77A}']
procedure ShowString(const s: string);stdcall;
procedure GetStringVar(var s: string);stdcall;
procedure GetInteger(var i: integer);stdcall;
end;
In Microsoft Visual C++ 6.0 exe I use this interface like this:
typedef char (*pShortString)[256];
class IMyInterface : public IUnknown
{
public :
virtual void __stdcall ShowString(char* s) = 0;
virtual void __stdcall GetStringVar(pShortString s) = 0;
virtual void __stdcall GetInteger(int* i) = 0;
};
Through a function call I get an interface pointer to the delphi
interface implementation.
I am able to use ShowString function :
char myText[256] = " Tarkan";
myText[0] = 6;
pMyInterface->ShowString(myText);
But when I try to use GetStringVar function:
pInterface->GetStringVar(&myText);
On delphi dll side I get an empty string and an exception after that.
I want to use GetStringVar interface function. What should I do?...I
want to keep using string(which corresponds to ShortString in this
case) on the Delphi side..Any ideas please?....
Thanks in advance....
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|