473,387 Members | 1,529 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,387 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 816

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...
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...
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...
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 the total memory usage of itself to screen. I...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.