tadina
18th November 2011, 10:21
Hello!

I need to write a dll in baan. I have never done it before. The problem is that in the dll I heve to call another dll before the functions are proccessed... something like in before.program (before.functions) section...... but in the dll there is no before.program section.

Why I need to have a dll is that the session tcedi0105m000 take only object from dll!

If you have any Idea I would be appreciate

JaapJD
18th November 2011, 14:28
This is not possible in a DLL. As an alternative you can call an initialization function as first statement in each external function. Example:

boolean me.initialized

#define ME.INITIALIZE {
^ if not me.initialized then
^ me.do.initializations()
^ me.initialized = true
^ endif }

function me.do.initializations()
{
|* Do anything you want
}

function long extern func.1()
{
ME.INITIALIZE

|* Do anything you want
return(0)
}

function long extern func.2()
{
ME.INITIALIZE

|* Do anything you want
return(0)
}

mark_h
18th November 2011, 16:35
Maybe I missed something - in the DLL you write, you just use the call to the other DLL in each of the functions. Just like jaapjd recommed, but calling the DLL directly. What was recommended there would also work and might reduce some coding.