Re: SafeArray Locked error (General questions)
Yes, I get 1.2.1.43 and modify it as follows. Is it DEPLHI7's problem ? I use delphi 7.0(build 4.453). Is this code error ? Would you please check it ? Thanks!
procedure TForm1.Button4Click(Sender: TObject);
var psaiNew : PSafeArray;
aDim : array [0..0] of TSafeArrayBound;
arraydata : Pointer;
v : Variant;
n : integer;
data : pointer;
buf : array [1..1024] of char;
begin
ShowMessage(wodVPN1.Version);
data := @buf;
n := 500;
aDim[0].lLbound := 1;
aDim[0].cElements := n;
psaiNew := SafeArrayCreate(VT_UI1, 1, aDim);
psaiNew.cLocks := 0;
if psaiNew <> nil then begin
SafeArrayAccessData(psaiNew, arraydata);
Move(data^,arraydata^,n);
SafeArrayUnaccessData(psaiNew);
TVariantArg(v).vt := VT_ARRAY or VT_UI1;
TVariantArg(v).parray := psaiNew;
wodVPN1.SendData(v, FALSE); // not reliable
end;
// wodVPN1.SendText(Edit5.Text, True);
end;
Complete thread:
- SafeArray Locked error - forthyen, 2008-01-14, 17:25
- Re: SafeArray Locked error - woddrazen, 2008-01-14, 17:52
- Re: SafeArray Locked error - forthyen, 2008-01-15, 02:31
- Re: SafeArray Locked error - wodSupport, 2008-01-15, 02:34
- Re: SafeArray Locked error - forthyen, 2008-01-15, 03:57
- Re: SafeArray Locked error - woddrazen, 2008-01-15, 08:49
- Re: SafeArray Locked error - forthyen, 2008-01-15, 08:54
- Re: SafeArray Locked error - wodDamir, 2008-01-15, 16:48
- Re: SafeArray Locked error - forthyen, 2008-01-15, 17:13
- Re: SafeArray Locked error - wodDamir, 2008-01-15, 16:48
- Re: SafeArray Locked error - forthyen, 2008-01-15, 08:54
- Re: SafeArray Locked error - woddrazen, 2008-01-15, 08:49
- Re: SafeArray Locked error - forthyen, 2008-01-15, 03:57
- Re: SafeArray Locked error - wodSupport, 2008-01-15, 02:34
- Re: SafeArray Locked error - forthyen, 2008-01-15, 02:31
- Re: SafeArray Locked error - woddrazen, 2008-01-14, 17:52