Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> GetProcAddress fails

GetProcAddress fails

From: Kekule <pr.chary_at_gmail.com>
Date: 13 Feb 2007 08:02:45 -0800
Message-ID: <1171382565.605457.60880@q2g2000cwa.googlegroups.com>


Hi,
I'm a newbie to the oracle.

I have got a a c++ code trying to open the dll "oraocci10.dll". The dll open call succeeds and it fails when try get the address of the procedure defined in it. Checked the dll with dumpbin utility it clearly shows the symbol.

Here is the code snippet.

#include "occi.h"
#include <tchar.h>
#include <errno.h>

using namespace std;
using namespace oracle::occi;

typedef Environment* ( *pCreateInstance)();

extern int errno;

int main(int argc, char* argv[],char *argv2[]) {

	String username="mdbadmin";
                String password="oracle";
	CFString connectString="//srisu02-lnx-t2:1521/orcl";

               pCreateInstance m_pCreateInstance=NULL;
	HANDLE m_hLibrary=NULL;

	m_hLibrary=LoadLibrary(_T("E:\\oracle\\product\\10.2.0\\db_3\\OCI\\lib
\\MSVC\\vc71\\oraocci10.dll"));
	if (m_hLibrary!=NULL)
		m_pCreateInstance	= (pCreateInstance)GetProcAddress(m_hLibrary,
"createEnvironment");

//Fails here m_pCreateInstance is "0x00000000"

        Environment *m_env = m_pCreateInstance(); }

I have checked the library getting loaded correctly. Could any one help me in this.

Thanks in Advance

~Panduranga Chary Received on Tue Feb 13 2007 - 10:02:45 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US