Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
aftershock is currently offline  aftershock
Messages: 141
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 #53113 is a reply to message #53112] Tue, 03 March 2020 09:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12281
Registered: November 2005
Ultimate Member
Well, I have no experiences with this. Frankly, it is also a couple of years since I have used Oracle last time....

Anyway. The error basically means that oci7.dll could not be dynamically loaded. For starters:

void DLLTYPE::Force()
{
	if(!DLLTYPE::Load()) {
//		RLOG("Failed to load required dynamic library '" << LibName() << "'");
		exit(1);
	}
}


I would uncomment that RLOG...

Also, details about host system, compiler and main configuration would be helpful here... Smile

Mirek
Re: cannot use oracle from dll [message #53117 is a reply to message #53112] Tue, 03 March 2020 12:11 Go to previous messageGo to next message
aftershock is currently offline  aftershock
Messages: 141
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

Re: cannot use oracle from dll [message #53118 is a reply to message #53117] Tue, 03 March 2020 12:57 Go to previous message
mirek is currently offline  mirek
Messages: 12281
Registered: November 2005
Ultimate Member
aftershock wrote on Tue, 03 March 2020 12:11
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.



Well, it is misleading, but rather common. Most libs that started with '32' in the name keep that even when recompiled as 64.

Anyway, glad to hear that the problem is solved.

Mirek
Previous Topic: [Solved]CoreTutoral package problem
Next Topic: lzma compression does not seem to work
Goto Forum:
  


Current Time: Wed Apr 01 00:24:20 CEST 2020

Total time taken to generate the page: 0.01240 seconds