Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: occi and windows
On Tue, 14 Jun 2005 16:21:37 +0200, "Michael Luchs" <mmr-michael_at_arcor.de>
wrote:
>I am trying to write a small occi windows applications. I am using VS Studio
>.Net 7 (Windows XP).
>
>I can compile and link my small application:
>
>int _tmain(int argc, _TCHAR* argv[])
>{
> Environment *env = Environment::createEnvironment(Environment::DEFAULT);
You haven't done any exception handling, so is env a valid pointer?
> try {
> Connection *con =
>env->createConnection("TESTUSER","TESTUSER","SERVERIP:1521/DBNAME");
If not, you'll get an access violation here.
> env->terminateConnection(con);
> } catch ( ... ) {
> }
> Environment::terminateEnvironment(env);
> return 0;
>}
>
>When I try to run the app I got the error message:
>
>'C:\oracle\ora92\bin\ORAXML9.DLL', Cannot find or open a required DBG file.
>C:\WINDOWS\system32\msvcirt.dll', No symbols loaded.
>Loaded 'C:\oracle\ora92\bin\ORAXSD9.DLL', Cannot find or open a required DBG
>file.
>Loaded 'C:\WINDOWS\system32\msvcp60.dll', No symbols loaded.
Normal debugger blurb under VS.NET...
>First-chance exception at 0x6087e01e in oracleoccitest.exe: 0xC0000005:
>Access violation reading location 0x4843494d.
OK, you've got an access violation, you're running under debug, what's the value of env? If you initialise it to NULL first, then assign it using Environment::createEnvironment, does it change?
>The program '[3792] oracleoccitest.exe: Native' has exited with code 0
>(0x0).
>
>The line Connection *con = env->createConnection(...) throws the exception.
>
>Does anyone whats wrong with my app?
If env->... causes an access violation, env is not a pointer to memory you own, therefore it seems Environment::createEnvironment failed for some reason.
-- Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk> <http://www.andyhsoftware.co.uk/space> Space: disk usage analysis toolReceived on Tue Jun 14 2005 - 19:20:25 CDT