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!

Calling another foxpro exe from an exe

Status
Not open for further replies.

flintstone42

Programmer
Aug 7, 2001
52
US
Hi:
I have appication A(Foxpro EXE) starts up,
the user logs in. Application B(Also a foxpro EXE) is started.

The user wants
1. Username from Application A to do auto login in App B
(and Viceversa)

2. When a record is select in APP A, APP B bring up the
same record.

I know 1 can be done with a file (C:\username.txt) but
I need to called the other exe for 2 anyway.

Is there any way for 2 exe's to to call function is other?
I know how to be with a COM object(will not work here, need
user interaction), ActiveX?

Any Ides?

 
Why not simply have a parameter in the main program for each .exe? If there's a value in this parameter when the program begins then it knows the user is already logged into another program and will call that program back asking for login. How that's done would I suppose be determined by your security system. If the parameter is blank then it asks the user directly.

Dave Dardinger
 
The user is getting into the application from an icon
on the desktop, no way to send a parameter that way.
I did find a way using the isrunning function with the window handler to see if the other app is running and then getting the username from a file the other app has written.

But I still need a way for App A to send a parameter and
trigger an event in App B when both are open already and
not opening up another instance.

Has any used the aPI function Sendmessage for something like This?
 
this may or may not be helpful / appropriate - we use the windows login username as the username in our applications and rely on the windows security. You can get this as follows;
PUBLIC LOGGEDIN
UNAM = ""
RetVal = 0
IPUserIDBuffer = SPACE(25)
nBufferSize = 25
DECLARE integer GetUserName IN WIN32API AS GetName ;
STRING @IpUserIDBuffer, ;
INTEGER @nBufferSize
RetVal = GetName(@IPUserIDBuffer, @nBufferSize)
UNAM = LEFT(IPUserIDBuffer, nBufferSize - 1)
LOGGEDIN = UNAM

* the variable LOGGEDIN now has the username in
Patrick Tuite
 
No good, we have several people login on the same iowndows logion,
also you canget the windows login from sys(0)?

I still need a way to fire and event in an exe from an
external exe,not a comobject
 
If I understand this scenario you have only one icon on the desktop - Application A. From somewhere within Application A the user want's to branch off to Application B. If that's the case, then why isn't Application B an APP instead of an EXE? It would be fairly simple to have the EXE pass user identification to the APP.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top