ravi_mehta
2nd December 2008, 13:43
Hi all,

I used this predefined variable in my dll, but i m getting the compile time error "variable not declared".

When i declare the variable as extern then it compile successfully,
But at run time when i m calling the dll function then getting attached fatal error.

Thank's in advance

KRKant

george7a
2nd December 2008, 13:54
Hi,

As what type are you declaring this variable? It should be String or MB.

Why do you want to use the same variable name?

- George

ravi_mehta
2nd December 2008, 14:08
Thanks george

for reply

actualy i was trying to use this predefined variable.
but it was giving the compile time error as "variable not declared".

thats why i declared it as extern string exit.val$(80) in my script.

but as it is predefined var, declaration should not be required.

i am using this var to get the exit value of sub process.

Thanks if not clear please get back to me.

Ravi

george7a
2nd December 2008, 14:26
How are you activating this sub process? What command are you using?
Who is activating it? which script? Is it the same DLL?

MilindV
2nd December 2008, 16:38
Hi George

I am replying on behalf of Ravi as I know the scenario.

I am using start.application.local to activate sub-process.
It is same dll which is activating the sub-process.
In the same dll i have used pre def var exit.val$.

In this start.application.local function i am setting wait flag as 'true' so that my application will wait till the local application exits.

but my local application exits in unexpected manner(say it breaks/fails anything not gets executed/exits in proper manner).

starts.application.local returns true even if my local applications fails.

so this is the scenario, I hope, I cleared myself.

just but one main thing(question) is how exit.val$ works?

Thanks
MilindV

george7a
2nd December 2008, 17:58
AFAIK, exit.val$ is a string returned to the called program at the end of the (baan) process and not for non-Baan applications like standard windows executables. Here is an example:
http://www.baanboard.com/baanboard/showthread.php?t=1751

The way I work when I want to communicate with a windows executable from Baan is through files. The baan script activates the executable, The executable generates a file (log) that includes everything it succeeded to do and then the Baan script will read this file.

Let me know if you have any other questions,

- George

ravi_mehta
3rd December 2008, 06:08
Hi George,

Actually from LN dll, I am starting the Baan4c4 application. The start.application.local() works properly when i am passing User & password correct. But when the user & password are incorrect the start.application.local() return me true. But while axecuting the Baan4c4 application i m getting BW message user name & password not correct. I am doing some operation based on the success of the above mention function. But if any error occurs, i want to catch that BW message, so that i can restrict further execution of code.

So How can i get the BW message of Baan4c4 in my dll. For the above requirement i was trying to use exit.val$.

Hopefully i explain my senario.

Thank's
Ravi

george7a
3rd December 2008, 13:01
exit.val$ won't help. It will return the result of the zoomed to session and not any other errors application.

By "Baan4c4 application" I assume it is a script/session that you wrote. Is that true? if yes, add a code to it that will generate a file when it launches. If the file was found (by the LN DLL) then the program was activated successfully if not, there must be an error. Remember to delete the file before you activate your baan4c4 application.

- George

ravi_mehta
3rd December 2008, 14:43
Thank's George.