473,322 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 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 !
Jul 19 '05 #1
0 1426

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 developer ODP.Net Please give advice do I need...
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 WITH CL.EXE (VC++) (compiles, but error when...
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 problem is that I have a project that makes heavy...
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 use the .NET framework features, but just continue...
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 need to know any factor that hs influence on cpu...
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 follows: oDB.AutoCommit = False...
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 can't get it to work with either - 'Unable to...
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 DLL, I have a database class (DbOO4OClass) that use...
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 used the following way. if à à à is set...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.