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

Launch external program from SIM (micros)

Status
Not open for further replies.

jd11111

Programmer
Apr 29, 2010
160
US
does anyone know how to launch an external program from a micros sim?
 
event inq : 1

var prog_num : n6 = 1 //// SET EXTERNAL PROGRAM NUMBER OR JUST PUT IT IN KEY DECLARATION
var ext_prog_key : key = key(26,prog_num)

loadkybdmacro ext_prog_key

endevent
























 
Thank you! This is very helpful!

Is it possible to pass a variable form the sim to the external program?
 
Where are you passing them, like command line switches or do you need to call myprogram.exe (var1,var2)?
 
into an asp.net application - it's loading a web page with the variable, such as employee number, passed to it.
 
Create a DLL, pass the variables to the DLL and have your DLL do the work.
 
that's what I thought you'd say :)

I'm trying to open the dll in the sim but it is not able to load.
the dll is "launch.dll" in cf\micros\etc

I'm trying this but it isn't working:

var Launch : n20 = 0

if Launch = 0
DLLLoad Launch, "Launch.dll"
endif

if Launch = 0
exitwitherror "Unable to Load Launch.dll"
else
infomessage "Launch.dll successfully loaded!"
endif
 
Have you tried to use the full file path for the CE client?


if Launch = 0
DLLLoad Launch, "cf\micros\etc\Launch.dll"
endif
 
I actually moved the dll to cf\micros\bin and got it to load....

Is this correct?
DLLLoad Launch, Start(variable)

I think the problem is either with the dll code or the syntax of the sim code. Does anyone have an example of a simple dll code to launch a program?


 
Hi,
Do you have the Enhanced Interface library dlls? Other calls are using MDSSysUtilsProxy.dll so you need to load that one too.
1. Create a global var for DLL like:

Var hSYSUTILSDLL : N12
Var hSYSCALLDLL : N12

2. Load its path & name based on OS like:

Sub LoadEIFCDll
Var strDLLNameWin32 : A99 = "eifc_lib.dll"
Var strDLLNameCEHHT : A99 = "\Micros\Etc\eifcCE.dll"
Var strDLLNameCEWS4 : A99 = "\Cf\Micros\Etc\eifcWS4.dll"
Var bRunningCE : N1 = 0
//Go through if statements then set the global VAR to your
//local VAR path like:
DLLLoad hSYSCALLDLL, strDLLNameCEWS4
//or with literal
DLLLoad hSYSUTILSDLL, "MDSSysUtilsProxy.dll"

3. Load & form your parameters like:

strSQLCMD = ""
Format strSQLCMD As "DELETE FROM custom.Tabs ",\
" WHERE CheckID = ", Chr(39), @CKID, Chr(39),";COMMIT;"

4. Call the DLLS & vars like:
DLLCall_CDECL hSYSUTILSDLL, sqlGetLastErrorString(Ref strSQLCMD)

The EIFCLib.dll provides the touchscreen layouts, types etc

S
 
mrpinks3,
Thanks, I actually know how to use MDSSysUtilsProxy.dll to query a database and get results.

What I'm having trouble with the is the actual DLL itself, not the SIM code. Do you have any info on how the DLL should be built? I am able to load the DLL, but I get a "function undefined" error when calling a function in a dll created using c#.

Also, do you have any information on the functions available in the micros Dlls?

thanks for your help!
 
Thanks, Steve - I have read the manuals.

The problem I have is not with the sim code...it's with the dll. I appreciate your time.
 
Hi,

The 3700 manual has really good reference. What is happening? Are you calling the DLL and its staying behind micros? Are you calling something like a CGI DLL, and its not executing / or executing & staying behind? Do you use Delphi? They have an app called Winsight32 to debug which may help.

There is a problem with some EIFCLIB.DLL versions (the Win32 version on PC2010) where the IFC screen was hidden behind Micros operations. I have the replacements of those if this is happening for you.
 
the purpose of the dll is to receive the emp_seq paramater. The dll was written in c#. Is that the problem?
 
is there a check open @ the time? If so there is the VAR @CKEMP (type N9)

 
Again, the issue is not in the sim. I have the employee sequence and I'm trying to pass that to a dll created which launches the web application using ieSample.

The problem is in the DLL...not the sim.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top