Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
E

evgumin

@evgumin
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Dynamic memomory error
    E evgumin

    I use new[] and delete[]. Please, explain what you intended in the second advice. And I represented the code in the answer to toxxct. Thank you.

    C / C++ / MFC debugging performance help question

  • Dynamic memomory error
    E evgumin

    There is a peace of code: void TStationArray::InitCollection() { CMegaBase base; CDBVariant** var; base.Query.Format("select STATIONNO from STATION order by STATIONNO"); if ( base.MakeSelectVar("", &var)!=-1 ) { for (int i=0; i This is a static method of the class TStationArray. Memory is occupied in calling base.MakeSelectVar("", &var). I reprsent this method below. `int CMegaBase::MakeSelectVar (CString query, CDBVariant ***vIn) { CDBVariant **v; v = NULL; CDatabase cdbMyDB; CRecordset recSet; if (query=="") query=this->Query; try { cdbMyDB.Open(server, FALSE, FALSE, initStr, FALSE); if (cdbMyDB.IsOpen ()) { recSet.m_pDatabase=&cdbMyDB; recSet.Open (CRecordset::snapshot, query, CRecordset::readOnly ); if (recSet.IsOpen ()) { int i=0,j; while (!recSet.IsEOF()) { recSet.MoveNext(); i++; } n=i; m=recSet.GetODBCFieldCount (); if (n!=0){ v = new CDBVariant*[n]; } if (!recSet.IsBOF()) { recSet.MoveFirst(); } i=0; while (!recSet.IsEOF()) { v[i]=new CDBVariant[m]; for (j=0; jm_strError +recSet.GetSQL ()); return -1; } catch (CMemoryException) { AfxMessageBox ("memExcept"); } if (vIn!=NULL) {*vIn=v;} pVar=v; return 0; }` Thanks for your help.

    C / C++ / MFC debugging performance help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups