for I := 0 to ListBox1.Count - 1 do begin if ListBox1.Selected[i]=True then begin sItemID:=OPCBrowser1.GetItemID(ListBox1.Items.Strings[i]) ; Edit3.Text:=sItemID; Edit4.Text:=VarToStr(OPCBrowser1.GetAccessPaths(sItemID)); end; end;
当执行到‘Edit4.Text:=VarToStr(OPCBrowser1.GetAccessPaths(sItemID)); ’时总是报‘Project OPCReadAndWrite.exe raised exception class EOleException with message ‘尚未实现’’,请问高手怎么解决
procedure TForm1.ADDBrowserItem;vari, iOrg: integer;sItemName: WideString;beginFOPCb := OPCServer1.CreateBrowser;iOrg := FOPCb.Get_Organization;if iOrg = 2 then //平坦式结构beginwith FOPCb dobeginFilter := '*';DataType := 0;AccessRights := 0;ShowLeafs(true);for i := 1 to Count dobeginsItemName := Item(i);TvItemView.Items.AddChild(nil, sItemName);end;end;endelsebegin //树状结构BrowseItem(nil);end;end;procedure TForm1.BuildTree(curNode: TTreeNode);vari: Integer;sItemName: string;sNode: TTreeNode;beginwith FOPCb dobeginShowBranches;for i := 1 to Count dobeginsItemName := Item(i);sNode := TvItemView.Items.AddChild(curNode, sItemName);MoveDown(sItemName);BuildTree(sNode);MoveUp;end;end;end;