Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 17797, pcAnywhere OLE Sample CRemoteData CRemoteDataManager

by Jim Ferguson Email: Anonymous


This sample uses the pcAnywhere OLE interface to establish a connection to a remote control data, but it will not allow you to change it if your using version 10.0.
Download Details
FTP  download also available 0 bytes
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 4.0  to 6.0 15 downloads
Copyright: No significant restrictions


Size: 0 bytes
Updated on Tue, 16 Apr 2002 07:24:59 GMT
Originally uploaded on Tue, 16 Apr 2002 07:24:34 GMT
Description
uses ComObj;
const
PCAServer = 'WINAWSVR.RemoteDataManager';
DefaultNetwork = 'network*.chf';
DefaultModem = 'modem*.chf';
ConnectionTypeTCPIP = 'TCP/IP';
ConnectionTypeModem = 'DEFAULT TAPI';
function GetRemoteData(var FileName: String; AccessMode: Word = 0): CRemoteData;
{ Type Libs are in a technical document at symantec's web site
www.symantec.com
search for:
How to Use the pcAnywhere OLE Specification

If you use the title for your search it should be the top one
After that, just import the type library.
}

{ Documentation:
http://www.symantec.com/techsupp/files/pca/pca_10.html
Look for pcaole.pdf
}

var
RemoteDataManager: CRemoteDataManager;
Path: WideString;
Temp: String;
begin
// RemoteDataManager := CoCRemoteDataManager.Create; Doesn't work
// RemoteDataManager := CreateOLEObject(PCAServer) as CRemoteDataManager; Doesn't work
RemoteDataManager := CRemoteDataManager(CreateOLEObject(PCAServer));
Assert(Assigned(RemoteDataManager),'No '+PCAServer);
if not FileExists(FileName) then begin
Temp := RemoteDataManager.CurrentDirectory;
if (Temp <> '') and (Temp[Length(Temp)] <> '\') then begin
Temp := Temp +'\';
RemoteDataManager.ChangeDirectory(Temp);
end;
Temp := Temp+ExtractFileName(FileName);
if not RemoteDataManager.FindFirst(Temp,Path) then
raise Exception.CreateFmt('%s invalid file name and default %s cannot be found',[FileName,Temp]);
Result := CRemoteData(RemoteDataManager.RetrieveObject(ExtractFileName(Path),1,''));
Assert(Assigned(Result),'No '+Path);
FileName := Path;
end
else begin
RemoteDataManager.ChangeDirectory(ExtractFilePath(FileName));
Assert(RemoteDataManager.FindFirst(ExtractFileName(FileName),Path));
Result := CRemoteData(RemoteDataManager.RetrieveObject(Path,AccessMode,''));
end;
RemoteDataManager := nil;
end;

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Server Response from: ETNACDC03