472,328 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

OO4O usage in a VC++ 6 DLL ?

Hi,

I'm just starting to use OO4O on a project and I do not know a lot
about Oracle.

I wrote a standard Windows DLL using VC++ 6.
In this DLL, I have a database class (DbOO4OClass) that use OO4O.

The DLL contains Startup and Shutdown functions that are called by the
application to do the OStartup and OShutdown calls.

When a DbOO4OClass instance is created, it creates one ODatabase and
one ODynaset objects (using new) that are used later in the class
methods to access the database.

aPtrConnection = new ODatabase;
aPtrRecordset = new ODynaset;
When the DbOO4OClass instance is destroyed, the destructor deletes the
ODatabase and ODynaset.

if( aPtrRecordset != NULL )
{
aPtrRecordset->Close();

// ****** memory problem when calling delete
delete aPtrRecordset;
aPtrRecordset = NULL;
}

if( aPtrConnection != NULL )
{
aPtrConnection->Close();
delete aPtrConnection;
aPtrConnection = NULL;
}

The problem is that when the aPtrRecordset object is deleted, there is
a memory exception. If I remove the delete, VC++ tells me that there
is a memory leak.
Everything else in the class works well (queries, calling stored
procs, etc...)

The same kind of memory error occurs in code like this:

for( int index = 0; index < fieldCount; index++ )
{
OField field = fields.GetField( index );

// do something with field
}

When the OField object is deleted at the end of the for loop, there is
a memory error.

When I follow the code in the disassembly window, the error seems to
be in the Oracle object destructor.
Is there something specific to do when using OO4O in a DLL?

Is it because the DbOo4OClass instance is created in the application
context and OO4O calls done in the DLL context?

Something else I missed?

Thanks for your help !
Jun 27 '08 #1
0 776

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Julia Sats | last post by:
Hi, I use in VB6 OO4O for connecting to Oracle, run procedures, sql queryes and so on. Now I am going to move to VB.Net. And I found that Oracle...
0
by: shamel | last post by:
Hi, I'm just starting to use OO4O on a project and I do not know a lot about Oracle. I wrote a standard Windows DLL using VC++ 6. In this...
3
by: Omid | last post by:
Hi. I have a piece of code that can be compiled and linked both with Cygwin g++ and with VC++. The code is: //WORKS WITH CYGWIN G++ //BUT NOT...
4
by: Andrew Ward | last post by:
Hi All, I was wondering if it is possible to use precompiled headers without having to include a <stdafx.h> or whatever in every source file. My...
8
by: Senapathy | last post by:
Hi, We are in the process of migrating from VS 6.0 to VS .NET 2003. Our code base in VS 6.0 is mainly C++. As a first step we do _not_ want to...
4
by: hmedinapy | last post by:
has anyone had a issue like this... My application (VB .net) starts using about 20% from cpu, and slowly increase the cpu usage to 100%. I...
2
by: CJM | last post by:
I'm using OO4O via ASP to manipulate an Oracle 10g database (v10.1.0.4). At the start of each vbScript section I'm starting off the transaction as...
8
by: CJM | last post by:
I have a working web application (ASP) which links to an Oracle 10g DB via OO4O. I'm trying to port it to either of two test servers, but in fact, I...
2
by: Sticker | last post by:
My question is, I want my program A have the ability to know how much memory is used by itself. So after it finishes certain function, it can print...
0
by: Mullai | last post by:
In VS2005, we have a set of VC++ 7 projects. We want to find whether a VC++ project used MFC or not in that particular workspace. To find that we...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.