Home » U++ Library support » U++ Library : Other (not classified elsewhere) » cannot use oracle from dll
cannot use oracle from dll [message #53112] |
Mon, 02 March 2020 21:28  |
aftershock
Messages: 143 Registered: May 2008
|
Experienced Member |
|
|
Hi,
I cannot use oracle from dll...
example
/#include <windows.h>
#include "dbconnect.h"
#include <Core/Core.h>
#include <Oracle/Oracle7.h>
using namespace Upp;
BOOL APIENTRY DllMain(HANDLE hModule, DWORD reason, LPVOID lpReserved)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
FileAppend f("dbconnectdll.log");
DllExport void Test() {}
DllExport void ConnectDb(char * connectstr)
{
Oracle7 oracle;
// One<Sql> Sqli;
// Sqli = new Sql(oracle);
oracle.SetTrace();
f << connectstr;
f.Flush();
OutputDebugString(connectstr);
/*f << connectstr;
f.Flush();*/
if (!oracle.Open(connectstr))
{
OutputDebugString("Can't create or open database file\n" + oracle.GetLastError());
// Cout() << "Can't create or open database file\n" << oracle.GetLastError();
// int b= 4;
}
else
OutputDebugString("connected");
// Sql Sqli (oracle);
}
I get an "Error loading OCI7 Oracle database client library
Note I did not get this error when I had the same code in a console application.
|
|
|
|
Re: cannot use oracle from dll [message #53117 is a reply to message #53112] |
Tue, 03 March 2020 12:11   |
aftershock
Messages: 143 Registered: May 2008
|
Experienced Member |
|
|
thanks I figured out
I compiled 32 bit version and the dll was 64 (ociw32.dll, oracle dll) bit version that is why it did not find it....
It is misleading that the name has 32 in it.
I downloaded 32 bit version of ociw32.dll but I got some weird error, end of story.
[Updated on: Tue, 03 March 2020 12:18] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 08:41:32 CEST 2025
Total time taken to generate the page: 0.02829 seconds
|