Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pcAnywhere and OLE problems 5

Status
Not open for further replies.

CathyG

Programmer
Jul 2, 2002
2
NZ
What I am trying to achieve is:

I have to create a Remote object which connects to a host in Antarticia, delete and rename files on that host then transfer files back to another host in New Zealand.

(at present I am using a direct connection, around my own network to try and achieve this before trying to connect by cable modem)
I am using pcAnywhere 10.5 and in this version the scripting has been removed. I have created a VB application (to work with pcAnywhere's automation server) which connects to my Host (fine so far), I can transfer the files no problem as I can use the AWREM32 FileTransferFromHost(HostFile,RemoteFile) function to do this. My problem is deleting and renaming files on the Host. What object do I use to do this?

Do I use the RemoteDataManager DeleteObject(Name,Password)object or do I have to get hold of the HostDataManager DeleteObject(Name,Password) object to do this? If so HOW?
There doesn't appear to be anything in the AWREM32 functions that can assist in this.

I have tried several different methods but without success.

Can anyone help? Please. Thanks in anticipation

Cheers
C
 
Hi Dankelt...I'm new with pcAnywhere, I've installed version 10.5
I know I can do an Auto File Transfer and create a shortcut on my desktop. BUT I need to do that from my VB app. But now I have a problem, I can't find AWREM32 and winawsvr in my VB Project's references. So I browsed for it,and found it in my pcAnywhere folder, but VB says "Can't add a reference to the specified file"...
How do I add them as references in my VB????
Help, please.
Thank you
 
wawanz, AWREM32.EXE and WINAWSVR.EXE are NOT the files you want to add to your project. The files are called AWREM32.TLB AND WINAWSVR.TLB. They are located somwhere on the pcAnyWhere CD, off hand I don't remeber where they are located, but they shouldn't be hard to find. I just copied those two files to my SYSTEM32 dir, then added them to my VB project.

Good Luck!
Dan
 
Dan,

Could you explain what you mean by adding the tlb files to your project. I have a working program but have not added the files to my project. I am assuming that it works because pcAnywhere is already installed.

Thanks!

Joe
 
The tlb files are the libraries that are used to control AWREM32.exe. If you do not add them to your VB project, you will get an error when you try to compile. You should get some kind of Variable or Object not defined error. I'm not sure how your program is working, but what you should have needed to do was copy the tlb files to your computer, then in VB go to Project, References, then add the two PCAW tlb files.
I'm not sure how you are able to get it to work without adding those files. What version of VB are you using?
 
Dan

awrem32.tlb and winawsvr.tlb are in my Windows/System32 directory.

awxferui and awfilexfer show up in project references but are not checked. OLE Automation is checked along with VB for Applications, VB Objects and Procedures, and VB Runtime Objects and Procedures.

I am building using VB 6.0 SP 5 and did not get any errors.

I added the two .tlb files to the project references and checked them.

Thanks for the info.
 
Hmmm - very interesting, I have been trying to do exactly what cathy is doing but through a modem dialup tot he remote computer.

The code kindly suplied by dankelt works upto the point of making the connection. As soon as we get out of the pause loop to check the connection, the connection is lost and the pcAnywhere window disappears.

Help would be much appreciated.
 
can you find out exactly what line is causing the disconnect? Is it on the check for Remote.ConnectionStatus or does it disconnect after that? Also, what is the value of Remote.ConnectionStatus before it disconnects.
 
This is the best discussion I've seen for pcAnywhere OLE support!

Alan - you can try to set both encryption levels (on the host and remote) to none and give your script another try. I ran across the same issue and changing the encryption levels worked. Also, make sure your host will accept calls from the user defined in your remote properties (name and password are correct).

I also have a question that I am hoping someone may know. Is there any way to dial into a host and figure out if the host is not logged into the network? I have a script that dials automatically into various hosts, but when I get to a machine that is not logged in, the script freezes indefinitely or until I cancel the script.

Any help is much appreciated. Thanks.
 
wrentmore,

That's interesting... What I've found in my testing is that it doens't matter if the pc is logged in or not. What matters is if the PCAW host is set to start as a service or not. Obviously if PCAW is running while not logged in it is running as a service. I have had problems with running the host as a service (things like printers, environment variables, etc. don't work because they are specific to user logons)

Right off hand I don't know if there is a way to do what you ask. What version of windows is running on your hosts?

Dan
 
Hi Dan,

Thank you for your response. I may be wrong, but if the PCAW Host is started when Windows starts, isn't it required to start the Host as a service? Maybe there is another way to automatically start a Host once the user logs into the machine (perhaps through the StartUp). Do you know of anything that may do this?

I'm using version 10.5 on mostly Windows 2000 machines. I just need some way to avoid PCAW freezing because the machine is not logged in, but also have it start again if the machine is rebooted (and the user logs in).

Thanks in advance.
 
I´m tying pcAnyWhere Ole with Delphi 5 and 6.
I´ve created 2 units with library import from winawsvr32.tlb and remaw32.tlb.

Im my first test i just tried to get the current directory using the method cremotedatamanager1.CurrentDirectory

I´m getting the message "Interface Not Supported". Does anybody know why ?????
 
I am trying to xfer several files the user specifies, they may be in several directories.

I am using a for loop to xfer each file but I have ran into a problem. PCAW gives control back to my app before the file is completely transferred. It does not do this on small files but if I use a 56k connection with about 1mb files about 2 minutes into it, it tries to send the next one.
This causes the xfer box to disappear and unexpected errors.

This somewhat reflects the problem of connection status but I can find no other solution that to hook the pcaw transfer box (PID) and loop until it disappears then wait a few seconds.

This seems a difficult way to solve this. Is there any other way?


Thank you for any help.
 
Hi Dan,

My name is Brian and I have been using PCAnywhere 10.5 for quite some time now and like its ease of use but am now in need of its use for automatic polling.
I have Visual Studio.Net which has VB and C+ and have been trying to follow the OLE Automation guide on the CD but am stuck on adding references to my Application so It doesnt compile correctly.
When I try and add the awrem32.tlb and winawsvr.tlb as references,(that I saved in the (WIN2K) System32 folder)I get an Error message which states, "Could not create the wrapper assembly for the ActiveX type library.... You may need to register it."

Can you help me? I have a week to create a polling program for my company. Is it because I'm using the .NET Framework? Do I have to use an older version of Visual Basic like 6.0 or Visual C+ 6.0 ? I don't want to have to reinstall an older version, since .Net was 5 CD's and took an hour to load.

Very Appreciatively,
Brian
 
Hi


i've used danklet code, but i'm getting a Runtime error telling me the "server threw an exception"

Any idea where this can come from ?

How can i use my active remote-host connection to program an automatic file transfer and execute an application on the host ?

Thanks for your help
 
I'm trying to use VB & pcAnywhere Automate the following but step 4 has me stumped. Any hints, clues or outright answers (I ain't proud) will be appreciated.

Task Status
1. Connect to a Host This bit works
2. Transfer files to the Host This bit works
3. Launch an application on the Host This bit works*

* The Host application then creates two data
files but takes 5 to 12 minutes to finish.

4. Test for the existance of
the data files. I don't know how.

5. Transfer the data files from
the Host to the Remote PC. This bit works

Please Help.
Also - thanks to all the great posts I was able to get this far with this project.

 
Leachim,

I don't believe there is a direct way to test for the existence of files using OLE Automation. You can always empty a folder on the remote, transfer the files you are trying to check from the host into the folder, and then use VB to check their existence on the remote.
 
I am using pcanywhere 10.5 on a Windows 2000 workstation and am having a very strange problem. I have a program that uses the OLE Automation that transfers files using the FileXferFromHost from a network drive. Once the files are transferred correctly I call a program on the host using the ExecuteHostFile, which seems to work except that it can't seem to access the network drives to delete out the files it just sent me.

If I dial in and execute the program on the host - not through OLE - the program runs fine. I have also tried a batch file through OLE and still does not delete out the files from the network drive. But when dialed in and run not through OLE the batch file deletes the files.

Is there a problem with accessing network drives on a Win2K pc through pcanywhere OLE Automation?

Any help would be greatly appreciated.

Thanks -- Art
 
ahomer1016

I had a similar problem.
I am using a batch file to perform the clean up on the Host but I found that the batch file has to change to the drive and then change to the subdirectory of the files to be deleted.

I don't know why - but it works.

Leachim
 
Hi, By making of use of code related to Awrem32.Application we were able to connect to a host, open a file from the host and then execute it. During our development we were working on PCAnywhere10.5. This was a VB application.
Now when our application is to be deployed, the machine on which it is supposed to be deployed version of PCAnywhere is PC Anywhere 9.2.0.
Now My question is- Is it somehow possible to have the VB exe containing the source code making use of object Awrem32.Application, to be possible to run on a machine which does not have PCAnywhere 10.5 or higher ? If it is possible, then How ? As i said, development is complete only we need to deploy it on the machine with lower version of PCAnywhere.
Thanks in advance, //Balwinder
 
I find this site very useful, but I still can't solve my problem when writing an OLE code for auto-tranformation of files between the host and the remote machine. My problem is that when I start receiving files from the host machine, the PCA prompts an error msg: "Unexpected error in AWREM32.exe...". I am connecting the host machine using 56K modem, does anyone know what happen? I have tried to do some pause after login to the host before starting the transmission, but it didn't work. Did anybody has experience on such problem or have some code that are work for auto-transmission of files written in VB? It would be grateful if this problem can't be solved. I have been disturbing with this error for already 3 weeks. Thanks in advance first!

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top