I need to make dll file for computing user defined function in Lindo Lingo. I need to implement two new functions, but I can make only one myuser.dll file for use in Lingo.
But, talking with people from Lindo, it is possible to make two argument myuser.dll function, with first first argument as a "branching" variable. for example, For example,
@USER( 1, 2.4)
might compute the sin of 2.4, while
@USER( 2, 2.4)
would compute the cosine of 2.4. The first argument of 1 implies return the sin, while a first argument of 2 implies return the cosine.
My question is how to do that, because I am new to Vc++.
Thanks in advance,
This way doesn work. I try it.
I have example for one function from Lingo manual (i.e. sqroot):
// routines for the DLL.
#define new DEBUG_NEW
static char THIS_FILE = __FILE__;
//NOTE-the ClassWizard will add and
// remove mapping macros here.
// DO NOT EDIT what you see in these
// blocks of generated code!
// The constructor
// Remove next line for a "quiet" version
// of MyUser.DLL
AfxMessageBox("@USER DLL installed");
extern "C" __declspec(dllexport)
void MyUser(int* pnNumberOfArgs,
double* pdArgs, double* dResult)
// This is an @USER routine callable by LINGO. In
// this particular case we simply take the
// square root of the first argument.
*dResult = sqrt(*pdArgs);
I contact them and they said that it is possible to use multiple functions with @USER by writing and compiling each function as a separate subroutine and taking an argument to @USER as the index number of the subroutine that you want to branch to.
Is there any chanse to see an example of how to do that, or explanation how to do that, because I am new in VC++.
I tried And I have no luck. They said that it is possible to use multiple functions with @USER by writing and compiling each function as a
separate subroutine and taking an argument to @USER as the index number of the subroutine that you
want to branch to.
I am interested how to do that.
Thanks in advance.