Click here to Skip to main content
15,913,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to Eliminate Child Window Title Bar Pin
Paul M Watt6-May-04 12:53
mentorPaul M Watt6-May-04 12:53 
GeneralMenu at runtime (dynamic menu) Pin
marcosvpp6-May-04 9:34
marcosvpp6-May-04 9:34 
GeneralRe: Menu at runtime (dynamic menu) Pin
Anthony_Yio6-May-04 16:21
Anthony_Yio6-May-04 16:21 
GeneralRe: Menu at runtime (dynamic menu) Pin
marcosvpp10-May-04 5:40
marcosvpp10-May-04 5:40 
GeneralRe: Menu at runtime (dynamic menu) Pin
Anthony_Yio10-May-04 16:14
Anthony_Yio10-May-04 16:14 
GeneralRe: Menu at runtime (dynamic menu) Pin
marcosvpp11-May-04 5:45
marcosvpp11-May-04 5:45 
GeneralRe: Menu at runtime (dynamic menu) Pin
Anonymous11-May-04 15:39
Anonymous11-May-04 15:39 
GeneralMemory Problem with AdoConnection Pin
VietDelphi6-May-04 9:24
VietDelphi6-May-04 9:24 
Hello:

I´m programming my application with MFC from VC++. Unfontunly, I have a serious memory problem in my application. with every each any operation the memory grows 4k. Also, the application has to make a big numer of operations, So the memory grows until the application crash.

Any operation is made in a separate thread. The thread is created and later destroyed after each operation. It uses a pointer which references the ado connection. The entity of the connection is created in the main thread. Inside the thread, I create , open, use and close a new Recorset. The recorset uses the connection pointer to access the database.

The creation and destruction of the thread is fine, because in operations without recorset, the memory is stable. However, the threads that use recordset prevent the memory being released appropiately.

This is the code that i use to create the connection:

_ConnectionPtr pConn;
pConn.CreateInstance(__uuidof(Connection));
pConn->ConnectionTimeout = 180;
pConn->CursorLocation = adUseServer;
//open conexion
BOOL aux = S_OK == pConn->Open( _bstr_t(m_conexion) , L"", L"",adOpenUnspecified);


This is the code that i use to create the recorset:

//******
_CommandPtr pCmd_SP;
pCmd_SP.CreateInstance(__uuidof(Command));

//establezco conex con comando
pCmd_SP->ActiveConnection = pConn;
// seteo sql
CString instruccion = "execute storeprocedureX";
pCmd_SP->CommandText = (_bstr_t) instruccion ;
// Create the variant NULL
_variant_t vNull;
vNull.vt = VT_ERROR;
vNull.scode = DISP_E_PARAMNOTFOUND;
// creo el Rs
_RecordsetPtr pRs_SP;
pRs_SP.CreateInstance(__uuidof(Recordset));
pRs_SP->CursorLocation = adUseClient;
pRs_SP->PutRefSource(pCmd_SP);
// Open the recordset
pRs_SP->Open(vNull, vNull, adOpenForwardOnly, adLockOptimistic, adCmdUnknown);
pRs_SP->Close();


Would you please help me to solve this problem?

Thanx



GeneralMemory Problem with AdoConnection -- Help!!!! Pin
VietDelphi7-May-04 0:51
VietDelphi7-May-04 0:51 
GeneralMemory Problem with AdoConnection -- Help!!!! - 2 Pin
VietDelphi10-May-04 3:40
VietDelphi10-May-04 3:40 
GeneralMFC Application To DLL Pin
Grahamfff6-May-04 9:16
Grahamfff6-May-04 9:16 
GeneralRe: MFC Application To DLL Pin
valikac6-May-04 13:19
valikac6-May-04 13:19 
GeneralList Contol Pin
kpatry6-May-04 8:35
kpatry6-May-04 8:35 
GeneralRe: List Contol Pin
David Crow6-May-04 8:42
David Crow6-May-04 8:42 
GeneralRe: List Contol Pin
Abin6-May-04 17:15
Abin6-May-04 17:15 
GeneralIntellectual property Pin
Jeff Bogan6-May-04 8:08
Jeff Bogan6-May-04 8:08 
GeneralRe: Intellectual property Pin
Christian Graus6-May-04 10:41
protectorChristian Graus6-May-04 10:41 
GeneralRe: Intellectual property Pin
Joe Woodbury6-May-04 11:53
professionalJoe Woodbury6-May-04 11:53 
GeneralMFC:Mnemonic executed without CTRL Pin
MarcoNedwig6-May-04 6:24
MarcoNedwig6-May-04 6:24 
GeneralRe: MFC:Mnemonic executed without CTRL Pin
Jens Doose7-May-04 0:48
Jens Doose7-May-04 0:48 
GeneralEnumDesktopWindows Pin
Member 10350186-May-04 6:01
Member 10350186-May-04 6:01 
GeneralRe: EnumDesktopWindows Pin
David Crow6-May-04 6:26
David Crow6-May-04 6:26 
GeneralRe: EnumDesktopWindows Pin
Member 10350188-May-04 23:13
Member 10350188-May-04 23:13 
GeneralRe: EnumDesktopWindows Pin
David Crow10-May-04 2:24
David Crow10-May-04 2:24 
GeneralTurn Off Monitor Pin
hkulten6-May-04 5:56
hkulten6-May-04 5:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.