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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pcANYWHERE OLE code for VB 19

Status
Not open for further replies.

fwadmin

IS-IT--Management
Jun 23, 2005
6
0
0
US
I have a bunch of pcANYWHERE script files written to do various automatic transfers. It seems that Symantec's newer versions of pcANYWHERE no longer support the script files and now use OLE for integration into other applications. The documentation for this completely stinks in that they give no VB examples of invoking transfers.

Anyone out there have any VB code with pcAYNWHERE they can share?

Thanks.
 
Hi
I created a program that works fine in ver 10.5
it connect with a host pc, send a file and execute a batch, but when i try it with ver 10.0 it start the connection and i can see the telephone number but it isn't composed by the modem...
Someone got same problem?

thx for help

 
Using FileXferFromHost Can i Send Multiple Files???

Like

V.FileXferFromHost('C:\TMP\*.*','C:\DLOAD\')

 
Hello,

I was happy to find this sample code but I can't make it to tranfer files. It calls the remote ok but doesn't do the transfer, either way. I always get the message transfer not successful.

Any idea ?

Thanks
 
Lodis
I had the same problem and discovered I had not made the directory I was transfering to on the Host. Make sure the paths on both ends exsist and that your spelling is correct.

John
 
Developed OLE code for Visual FoxPro. Works 80% of the time. Multiple file transfers seem to step on each other SOMETIMES. Cannot determine what causes failures. I have tested calling same PC multiple times by looping through the code. In performing calls 15 times, I have never had 100% success.
Does anyone have OLE for VFP examples?
Thanks.
FDC
 
Meldric:

Thanks a lot for the code that you posted on this thread, but I have one slight problem with the way that I have to do it. I first use pcanywhere to dial in to the client site. Then, I run this program to download the files. The issue is that I have to establish another connection back to myself in order to use the functions of AWREM32. Is there any way to just set the active connection to the object so I don't have to establish a second connection?

Thanks
Mike
 
mgerbs,
Have you found you answer to your question? Im in the same predicament. Most of the the time that I will use OLE I will already be connected to the HOST and will need pcanywhere to use the active connection instead of establishing a new one.

If I find the answer before you I will post, I guess here.

By the way, great info Meldrick
 
Hey durda:

The only answer that has been suggested to me is that I would have to create two seperate programs, but I am still looking for a better answer because I don't think that it will give me everything that I want. I need to be able to make the initial connection with pcAnywhere because of the possibility that other functions will need to be performed on the host.

So, if you come up with an answer, I would be very interested in hearing about it. If I find an answer, I will do the same.

Thanks
 
pcAnywhere OLE certainly leaves a lot to be desired. Thanks to all for the code on this site. I have been able to use it and have a somewhat working application. I say somewhat because of the limitations of Symantec's OLE implementation. As near as I can tell awConnect always returns TRUE whether or not the connection was successfull or the user cancelled the request. My users (some 25 sites that were using 9.2 and now need to use 10.5 and OLE) all call a host at about the same time. Therefore, many get busy signals. For purposes of discussion, lets say the CHF file is set for 3 retries 10 minutes apart. Since awConnect does not return connection status, all I can do is check connection status periodically for a full 30 minutes or until a connect occurs as shown earlier in this thread. That is fine if I am eventually going to connect; however, if the user wants to touch the CANCEL button on the pcAnywhere connect dialog box, the dialog box goes away, but the application is still checking status for the full 30 minutes. Not acceptable to my customers.

So far my work around has been to control the retries and the delay between retries in the application rather than letting the CHF file dictate them. This mostly works except for the fact that you can cancel the pcAnywhere dialog and still be in a delay waiting for the modems to sync. It is also confusing because you have two cancel functions. One to cancel pcAnywhere and another to cancel the application retry loop. This is further complicated by the fact that if you touch (yes it is a touch screen application) an area outside the pcAnywhere dialog, you get a component busy error dialog. All in all pretty ugly.

Has anyone else encountered or solved this problem or have some better ideas?

Thanks!
 
Has any one solved the issue of retain ght econnection over a modem link so that a file can be transferred?
 
AmeriTouch
I'm still a little green when it comes to VB but here goes nothing...
You are correct that AwConnect pretty much always returns True. It seems that this only indicates that the command line was run and has no real bearing on the actual success or failure of the command itself. This is also true of the FileXfer commands by the way. Basically these returns mean nothing.
What I am doing is right after the awConnect command I check the connection status like this..
AwConnOK = oTestApp.awConnect(sPcaChfFile)
ConnOK = oTestApp.ConnectionStatus()
If ConnOK = False Then
GoTo NoConn
ElseIf ConnOK = True Then
T1 = Timer
End If 'ConnOK
If the status came back false then in your case I would NoConn be some code that would prompt the user to continue waiting or quit.
If they choose quit then issue exit to quit the program.

Hope I helped
John
 
If you want to avoid having to sign on to the remote host, add the Username/Password info the the .CHF properties. You can use the WINAWSVR.BEHOSTDATAMANAGER and add the info programatically, or you can edit the properties of the .CHF right in PCA.

As for the connection window (with host machine displayed), I'm pretty sure if I can get the code right that the window is simply hidden, and sending a Show Window command to the handle for that window (pain to find, but possible) it should come to the top. I've had it pop up a few times by itself, but I'm not sure how/why it did.

I've only been working with this stuff for a few hours, but give me a couple weeks, I should have some decent code to share.
 
Hi there. I feel stupid but I can't launch my pcanywhere host from a vb application. I mean, I created an host object called test, but cannot find no test.bhf file on the disk. I tryed with the ole automation, but it didn't help me. I just want my application to tell my pc to be a host (getting parameters from an exiting pca host object - that test thing- already created).

Thanks for replying.
D.
 
To find your test.bhf file, try clicking on the desktop and hitting F3. Search for *.bhf on local hard drives. It has to be there someplace. If that still doesn't find it, have you looked for TEST*.*? Maybe the file name was wrong when you saved it.

As for starting a host file, I don't remember seeing a direct way to start a host via automation objects, but you can should be able to use the VB Shell function to run the host file.
 
Hi, of course I did search for bhf files, but with no success. It seems that pca doesn't save them to the disk, though i can see them on its panel. Now, I also tried creating a link to that "test" object and launching it via the vb shell command, but i got an error message saying it was not able to start the program. Any other idea about starting the host via vb?

Thanks and regards,
D.
 
What is?
OS & Service Pack
PCA Version
User Level within OS (admin, basic user, whatever)
Did you install Host & Remote, or just one of the two? Have you tried dragging a BHF entry to the desktop from PCA? (or right click the BHF & copy/paste to desktop) (or paste as shortcut to see where it lives)

I've never seen any version of PCA that DIDN'T save files for host/remote, so I don't have a clue on where yours might be. (and I've been a PCA user since it was DOS only)


 
bmettee, thanks for your help.

Windows 2000, sp3, pca 10.5.1

user level: local admin

I installed host and remote and i already tried dragging the bhf entry to the desktop, and i got an error message when launchin it from within vb.

I created both test bhf and chf files, if i try and search them for name, i cannot find them! what is the default directory where pca usually stores those kinds of files?

D.
 
I am so sorry. It must be stress. It what hidden. the folder was hidden i could not find the files.

my apologies and thanks againg for your kind help.

D.
 
Congrats on finding it!

Now all you need to do is get it to shell & run.

btw: here's what I was writing when your new reply showed up.

-----
Pull up a CMD prompt, type SET. The ALLUSERSPROFILE environment var points to the folder where you can find Application Data\Symantec\PCAnywhere. The App Data folder is hidden by default, so there is a possibility that Search won't find it (or anything under it).
-----
 
but i again when running those command
i = Shell("C:\Documents and Settings\All Users\Dati applicazioni\Symantec\pcAnywhere\blablabla.bhf")

it returns with a run-time error '5' (sorry i don't know how to traslate the description in english).

Any clue on it?

D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top