From: ...
Sent: Monday, October 14, 2013 11:50 AM
To: Zbynek Zahradnik
Cc: ...
Subject: Re: QuickOPC problems
Hi
This is the code that returns 0 items only for "Demo" leaves.
I have run with only constants
vDictionary := DA.BrowseLeaves('localhost', 'OPCLabs.KitServer.2', 'Demo', EmptyStr, EmptyStr);
with the same result.
I have used Delphi 2010
Hope this is enough for you.
function TBrowseOPC.EnumLeaves(pParent: TTreeNode): integer;
var
pUnk: IUnknown;
vDictionary, arNodes: OleVariant;
nIndex: integer;
pInfo: DANodeElement;
crOld: TCursor;
begin
crOld := Screen.Cursor;
Screen.Cursor := crHourGlass;
try
vDictionary := DA.BrowseLeaves(GetID(pParent, ntMachine), GetID(pParent, ntServer), GetID(pParent, ntBranch), EmptyStr, EmptyStr);
// This is the call thats returns 0 items (count = 0 below).
// vDictionary := DA.BrowseLeaves('localhost', 'OPCLabs.KitServer.2', 'Demo', EmptyStr, EmptyStr);
arNodes := vDictionary.Items;
Result := vDictionary.Count; //Returns 0 only for Demo!!!
for nIndex := 0 to Result - 1 do
begin
pUnk := arNodes[nIndex];
pInfo := pUnk as DANodeElement;
AddNode(pParent, ntLeaf, pInfo.Name, pInfo.ItemID, false);
end;
finally
Screen.Cursor := crOld;
end;
end;
Med vänliga hälsningar/Best regards
...
...
“Please have them send us their source code. They are probably doing something wrong when calling the Browse methods.”
...
From: ...
Sent: den 11 oktober 2013 14:35
To: ..
Subject: Re: QuickOPC problems
...
Hello,
We are upgrading QuickOPC from 3.03.
We are Delphi 2010 with the QuickOPC COM interface and have some problems.
At first we tried in version 5.12 the "Demo" and "Trends" branches never did returns any leaves when calling BrowseLeaves
In 5.22 the fault is still in "Demo" branch but now it returns correct in "Trend" branch as the picture shows.
All other BrowseLeaves seems to work OK.
Subscribing is working for each leave of the Demo branch.
Note! All this was working correct in the Demo application that was provided with the installation.
I have attached the program written in Delphi 2010 if you want to test. It´s for the version 5.22.
Rename to .exe
--
Med vänliga hälsningar/Best regards
...