SafeArray Locked error (General questions)
Hi, I use delphi7 and call SendData in wodVPN.dll then get SafeArray Locked error but not in wodVPN.ocx. Why?
Hi, I use delphi7 and call SendData in wodVPN.dll then get SafeArray Locked error but not in wodVPN.ocx. Why?
by woddrazen
, (6505 days ago) @ forthyen
Hi forthyen,
I cannot duplicate your problem. Did you maybe try with our sample for Delphi 7? You can find it in wodVPN Samples folder.
Also please make sure that you are using latest 1.2.1.43 version of wodVPN.
You can check version in wodVPN Version Property.
[code]ShowMessage(wodVPN1.Version);[/code]
Let us know how it goes.
Regards,
Drazen
by forthyen
, (6505 days ago) @ woddrazen
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;
by Jasmine, (6505 days ago) @ forthyen
Thanks, we will check it out. Can you just tell me exactly on which line error occurs? In wodVPN or in your code? If in your code, where?
Kreso
by forthyen
, (6505 days ago) @ Jasmine
at
wodVPN1.SendData(v, FALSE); // not reliable
and get
Project Project1.exe raised exception class EVariantArrayLockedError with message 'Variant or safe array is locked'. Process stopped. Use Step or Run to continue.
Thanks!
by woddrazen
, (6504 days ago) @ forthyen
Hi,
I think I was able to duplicate the issue.
I will now transfer this ticket to our developers to see if they can do the same in debug mode, and determine why this happens. You should get reply from them during the day.
Drazen
by forthyen
, (6504 days ago) @ woddrazen
Hi,
Thanks you very much! I hope this problem can be solved.
by wodDamir
, (6504 days ago) @ forthyen
Hi,
I believe this is now fixed. Can you please download the latest version and try it out?
Also, you can try the following code (instead of yours):
[code]procedure TForm1.Button4Click(Sender: TObject);
var arraydata : Pointer;
v : Variant;
n : integer;
data : pointer;
buf : array [1..1024] of char;
begin data := @buf;
n := 500;
v := VarArrayCreate([0, n-1], varByte);
arraydata := VarArrayLock(v);
Move(data^,arraydata^,n);
VarArrayUnlock(v);
wodVPN1.SendData(v, FALSE); // not reliable
VarClear(v);
end;[/code]
Regards,
Damba
by forthyen
, (6504 days ago) @ wodDamir
Yes, good! Thanks !

May I say how nice it is to work with components so complete and self-explanatory that using them in my application is as instinctive as though I wrote them myself?

You have been great as far as offering support is concerned and has been extremely responsive to both support requests and suggestions for product enhancements.

We have recently completed a large 1200+ location project where reliable Telnet and SSH connectivity was required. wodSSH worked flawlessly and allowed our staff to complete our project ontime and within budget.

It is very refreshing to find such helpful, knowledgeable and quick responding technical support.

Thank you for the great customer service ... I am really impressed with the wodSSH ActiveX control.

This has been, by far, the best experience I have ever had dealing with a support entity in my long career in the technical arena

I would highly recommend this to anyone who needs a good quality SFTP solution.

We have recently completed a large 1200+ location project where reliable Telnet and SSH connectivity was required. wodSSH worked flawlessly and allowed our staff to complete our project ontime and within budget.

Just thought you'd like to know that my gateway app with your SMTP Server component held the line against a DDOS attack today...

The people at WeOnlyDo are amazing! ... I always get a super fast response from customer service, and the products are great too. Thanks WeOnlyDo

