fmchong
28th January 2010, 09:17
Dear Baan Expert,
I would like to call an external exe program from ERPLN session.

example: Notepad.exe path : D:/Windows/System32

as i know is using function long app_start(). Can I have the sample of the script of this function to call notepad.exe from session.

Thank you..

bdittmar
28th January 2010, 09:25
Dear Baan Expert,
I would like to call an external exe program from ERPLN session.

example: Notepad.exe path : D:/Windows/System32

as i know is using function long app_start(). Can I have the sample of the script of this function to call notepad.exe from session.

Thank you..

Hello,

BaanERP Programmers Guide


app_start()

--------------------------------------------------------------------------
Syntax
long app_start( string commandline, string directory, string stdin, string stdout, string stderr )
Description
This starts the application specified in the commandline argument. It returns an ID for the started application. You can subsequently use this ID as the app.id argument in the app_status() function.

Arguments
commandline
This specifies the command that starts the application. If commandline does not include a directory path, Windows searches for the executable file in the following directories, in the order shown below:

The directory where BW is loaded.
The Windows system directory.
The Windows directory.
The directories listed in the PATH environment variable.

directory
The default working directory for the application.

Note
Some applications handle the default working directory themselves and are therefore not influenced by the setting of this argument.

stdin
The standard input file name.

stdout
The standard output file name.

stderr
The standard error file name.


Notes
If commandline specifies the name of a nonexecutable file, Windows starts the application with which the file name extension is associated. For example, if commandline is c:\temp\file.txt, and .txt is associated with the Notepad application, Windows will start Notepad. Because users can change the association of a file name extension, you cannot predict which application will start.

This functionality is not available when you specify standard input, output, and error files.

Return Values
>=0 Identification number of the started application is returned.

<0 Error. The negative value of the system error


Context
ttdllbw library function.

Regards

fmchong
28th January 2010, 09:34
I gone thru the this guide but i still not able to write the script.

Please Help!

MilindV
28th January 2010, 11:01
function try009()
{
domain bcmig.str512m local_command
long ret
long exitcode

local_command = "cmd.exe /C notepad.exe"
ret = start.application.local(local_command, true, exitcode)
if ret then
message("Process Completed Successfully")
endif
}

bdittmar
28th January 2010, 13:10
I gone thru the this guide but i still not able to write the script.

Please Help!

Hello,

something like :

if (tccom000.ncmp = 100 or tccom000.ncmp = 113) then
app_id = app_start("WINWORD.EXE N:\Lust\Artikel\Zeichnun\"&dateiext, "", "", "", "")
endif

Regards

Juergen
28th January 2010, 14:32
Hello Bernd,

function app_start() is deprecated (please refer to the actual ERP LN Programmers Guide), so it`s better to use function start.application.local() as mentioned by MilindV.

Regards,
Juergen

fmchong
29th January 2010, 07:46
Dear Baan Expert,
I been tried and when i compile the program script and error prompted me as per attached.

Please Help.

Thank you very much :)

MilindV
29th January 2010, 08:03
Hi fmchong,

Use need to link this dll ottdllbw. Put following line before calling function start.application.local.

#pragma used dll ottdllbw

Regards
MilindV

fmchong
29th January 2010, 09:20
Dear All,
My problem resolved.

Thank you very very much for the replies. :)