Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PCAnywhere
Message
General information
Forum:
Visual FoxPro
Category:
Third party products
Title:
Miscellaneous
Thread ID:
00639549
Message ID:
00643179
Views:
29
Hi Enmanuel,

Yes, this is a great help. I assume, I can use ShellExecute API function instead of WSH, because I can not be 100% sure about its existance.

Could you also please show a COPIARINV method of the form?

Thanks again for your help.

>>Hi Emmanuel,
>>
>>Could you please provide more info about item 3 in your message? I may have the same issue with invoking PCAnywhere from VFP application and have predefined folders on Host and Client selected. If you can send some examples to my work address, it would be terrific.
>>
>>Thanks a lot in advance.
>>
>
>Hi Nadya, as I said in my previous post the greatest part of the job is to configure PCA. When you create a new host or remote connection it creates a file for that connection. In the case of a host its extension is .BHF, in the case of a remote it is .CHF. So, you only have to make a call to these files and they will start it associated application, pcAnywhere in this case.
>
>This is the code in my host Procedure:
>
>
>&&&& Name and Location of the PCA host configuration file
>cRecibir = "c:\Program Files\Symantec\PcAnywhere\Data\Hostfile.BHF"
>****
>#DEFINE SW_HIDE 0
>#DEFINE SW_NORMAL 1
>#DEFINE SW_MINIMIZED 2
>#DEFINE SW_MAXIMIZED 3
>
>cComando = Alltrim(Trarun.comando2)
>cRecibir  = Alltrim(Trarun.Recibir)
>oShell=CREATEOBJECT("WSCRIPT.SHELL")
>
>&&& The next line of code launch PCA and wait till program exit
>oShell.Run(cRecibir, SW_NORMAL, .T.)
>
>! &cComando   &&&& This line run Winzip to decompress the data
>
>THISFORM.COPIARINV(2)  &&& Method to copy the downloaded data
>
>Close Data All
>**********************************************
>
>MESSAGEBOX("*** DATA TRANSFERED ***",0,"DATA TRANSFER")
>Thisform.Release
>
>
>
>Trarun is a config file where I save all the parameters needed to launch the files. For example in this file I saved the commands for winzip that I need to send to decompress and compress the data and also it contains the location of the PCA host and remote files.
>
>This is the remote procedure:
>
>
>#DEFINE SW_HIDE 0
>#DEFINE SW_NORMAL 1
>#DEFINE SW_MINIMIZED 2
>#DEFINE SW_MAXIMIZED 3
>
>ThisForm.Copiardesde1.Enabled=.f.
>This.Enabled=.f.
>
>		
>THISFORM.COPIARINV(1)   &&& Method to extract the data from the VFP Tables
>
>cComando = Alltrim(Trarun.comando)  &&& set the command line for Winzip
>Close Data All
>*************************************************************
>! &cComando   &&& Launch Winzip to compress the files
>
>oShell = CREATEOBJECT("WSCRIPT.SHELL")
>
>
>*** set the location & file name of file to send
>cEnviar  = Alltrim(Trarun.Enviar)
>
>If File(cEnviar)
>   oShell.Run(cEnviar,SW_NORMAL,.t.)  &&& Establish PCA Conn.
>Else
>   MESSAGEBOX("*** FILE NOT FOUND ***",16,"DATA TRANSFER")
>Endif
>
>MESSAGEBOX("*** PROCESS ENDED ***",0,"DATA TRANSFER")
>Thisform.release
>
>
>I simplified the code a little so it could be easier to understand but I hope it can help you. You may note this program lack an error handling routine but since my connection is very good I have no problem with this and the only error I'm aware of is the "File not found" error.
>
>Hope it can be of any help,
>
>Enmanuel
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform