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

RAMANI (everybody welcome) : run a program in specific pc on the netw?

Status
Not open for further replies.

eys

Programmer
Mar 5, 2001
28
MX
Ramani (everybody welcome) :

What can i do to run a program in a specific pc on the network?

This is the case:
1. I have a dbf in the server with the user name and machine name log into the vfp program.

2. I need to activate, or pivot, or run a program or form or API, to ask for an authorization for one specific user in one specific pc. This is for price override autorization.

3. How can i do this? The problem i cant solve, is how to tell the pc to start or run automatic prg without using a clock. Do I need to use RPC (and how?) or there is another shortcut to this problem.

Thanks

Jose Carlos
eys
 
Jose,

One possibility would be to use DCOM. Basically, you create a class which contains the code that you want to run. You then turn that into a COM server, then instantiate if from another machine.

I'm not an expert on this. However, if you look at the Help for CREATEOBJECTEX(), that should get you started.

Mike


Mike Lewis
Edinburgh, Scotland
 
Another option,if you have a VFP program running on that machine, is to use the client server code that has been tossed around for chatting, and make the VFP program listen on a specific port for connections.

You'd have to create your own protocol for asking the query and giving the response.

This question (basically, how to access VFP from a remote machine) comes up over and over: If there were a simple toolset to make VFP into a server program (like SQL server) it would probably be pretty popular. ("Simple" being the key!!!)

Sound's like a job for a FAQ! or even a commercial VFP server toolkit....
 
DCOM would be a good choice for this however it is messy to setup permissions come into play and supporting it can become troublesome (in my opinion/experience) if there was no other option we do what we have to. I for one was very interested in the thread on the VFP Chat and have been expanding on this function and I think this is a good match for this issue. How I see this would be a TCP port (very simple) listener running as a service on Supervisors(???) computer when it gets traffic on the specified port it could just ! myVFPApp.exe the Service could be very small and lightweight and would act as a "Launcher" It could even "Ring the Bell"

Steve Bowman
steve.bowman@ultraex.com

 
Hi Jose Carlos,

1. Look into this thread
VFP Chat Client
thread184-541348
Aircon's code is nice and can be used.

2. Toy can use a separate form or whatever to be started automaticaly when the window is started in each of these sanctioning officers computers.
a. The form should have a timer event to pop up appropriate message and can be timed every 2 or 3 seconds to look for the appearance of a file in a specific directory. (one directory for each of the sanctioning person).
b. The users terminals can put a file with info such as the document no. or whatever into the specific directories in the server, when the user needs a specif officers sanction.
c. The action (b) will fire the timer event said in (a), and the timer event can call the method, to read the file.. obtain the document reference or whatever it has to do to lead the officer to the correct screen from his terminal and also delete the file.

However, if Aircons method suggested in (1) can be adapted, it opens a whole new way of handling the whole converstaion situation oriented and person to person.. without leaving the application and without any tele conversation.

:)


ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Hi Steeve Bowman,

I think we two were on the same question with same answers of CHAT topic almost simulataneously and you clicked the submit button just before me. What a coincidence.

:)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
This is a pretty cool concept, I think I might tap out a few lines real quick for "Remote authorization que"[/red] will post a [pipe]short[pipe] example when complete.[hourglass] I have a need for this very item.

Steve Bowman
steve.bowman@ultraex.com

 
To add one more post, you should use DCOM.

I believe it is the best solution for the problem
at hand, although not the easiest to design and maintain.

Although having an application running all of time
that checks to see if any remote machines need attention
through semaphores is a viable solution, it has the problem
of eating up lots of system resources.

Through the use of DCOM, each node can instance an
application object on the server when required and if
designed properly will just die when the app kills it,
or stops running.

There are of course many situations where a constantly
running server app is the best solution, but this may
not be one of them.

One CAVEAT...

If your app will need lots-and-lots of over-rides,
a constantly running app may be the better solution -
and is of course the easiest to implement and maintain.

You can issue requests to the server app through a
shared table on the server which tells the running app
that your app requires attention. The server replies to
the requesting app via another entry into the same or
different shared table.

The design and implementation is up to you.

Good Luck!


Darrell


'We all must do the hard bits so when we get bit we know where to bite' :)
 
I am looking at a process that will not use semaphore table or semaphore files but an XML string passed over a TCP port to a listener that would standby "hidden and idle waiting" and would pop a window when needed asking for authorization of the tasks asked for in the XML request string and respond back via-tcp port session returning XML Data reply and then back hidden idle state. I am not sure but I believe the processor overhead on a TCP port listener is minor. I do agree that this implementation of DCOM is the very thing MS had in mind when designed. I am going to proceed with this port idea (if for nothing else but the learning potential) because I many times have resorted to semaphores both Table and File but never cared for the polling overhead.

Steve Bowman
steve.bowman@ultraex.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top