Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: GetProcAddress failing
On Feb 13, 5:56 pm, "Kekule" <pr.ch..._at_gmail.com> wrote:
> 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
Did you first check that createEnvironment is exported from this DLL. You can use Dependency Walker to check it.
Good luck.
BR Deyan Received on Fri Feb 16 2007 - 03:53:22 CST
![]() |
![]() |