Referencing External C# DLL in Clarion - DLL path default to root of C

I have successfully implimented an C# dll where I call functions from. This is working.
But the issue is that no matter what I try, Clarion insists that the external dll must be in the root of C. How can I get Clarion to look for the dll in the directory of the app?

Global embed - Inside Global Map

MODULE( ‘C:\SBS\Opto22Clarion.dll’)

R1Controller_ConnectToPLC( bstring), LONG , NAME( ‘R1Controller_ConnectToPLC’), pascal,raw,dll( true)

R1Controller_DisconnectFromPLC (), LONG , NAME( ‘R1Controller_DisconnectFromPLC’), pascal,raw,dll( true)

R1Controller_GetIntValue( bstring), LONG , NAME( ‘R1Controller_GetIntValue’), pascal,raw,dll(true)

R1Controller_GetFloatValue( bstring), REAL , NAME( ‘R1Controller_GetFloatValue’), pascal,raw,dll(true )

R1Controller_GetFloatTableElement(bstring , Short), REA ,NAME(‘R1Controller_GetFloatTableElement’) , pascal,raw,dll( true)

R1Controller_GetIntTableElement( bstring , Short ), LONG , NAME( ‘R1Controller_GetIntTableElement’), pascal,raw,dll(true)


MODULE( ‘Opto22Clarion.dll’)

should do a trick and look in the current app folder (Start In folder)

The compiler strips the path and extension from the parameter of MODULE. The only goal of parameter is to find whether functions prototyped in this MODULE are external for the compiling source.

Does the problem happen at compile/link time or when the program runs/starts?

Thanks. Ive tried that but no luck.
I ended up using the dll functions from the WinEvent template from Cape Soft.
That works.

Once I had a DLL (I think it was PowerTree from PowerBasic) that had a hard coded path in the .lib that got created with LibMaker.

Is that the kind of thing you’re experiencing?

I modified the libmaker source to strip out the path, then it worked.