I have a database app in unmanaged code, with many DLLs. I have a web service server (managed code) that, when called, must call a function in one of the unmanaged database DLLs. That all works OK except for this: the DLL that gets called is completely uninitialized, loaded fresh from the disk. Very bad, because it really isn't part of a running program, so it blows up immediately. The DLL that I want is already in memory, running as part of the database app. There is only one DLL of that name on the computer. In the web service class declaration, I'm using something like this:
using namespace System::Runtime::InteropSe
public class pipe
static short WebQA(char*,long*);
where the DLL path is spelled out. Any way to link to the DLL in memory so that this thread joins the current process?
Also, can LoadLibrary() be used to link to an unmanaged DLL from managed code? MS documentation doesn't say you can't, but it doesn't seem to work either.
Thanks for any advice.