Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

inconsistent behaviour with recordset NEW () and AddNew ()

$
0
0

i have run into a very strange and inconsistent behaviour of VC++2010 IDE

given this recordset

LONGLONG m_ID;

long m_lingua;

CString m_titolo;

CTime m_dataemissione;

int m_fonte;

CString m_cryptedfilepath;

CString m_tabellaindice;

long m_num_ind;

bool    m_border;

bool    m_xdom;

CString m_triass;

LONGLONG m_offset;

and this method  which i have extracted from the standard constructor

void Crecdocumenti::Azzera(void)

{

m_ID = 0;

m_lingua = 0;

m_titolo = L"";

m_dataemissione=NULL;

m_fonte = 0;

m_cryptedfilepath = "";

m_tabellaindice = "";

m_num_ind = 0;

m_border = 0;

m_xdom = 0;

m_triass="";

m_offset=(LONGLONG)0;

}

when the constructor is called  in a statement like

crdoc = new Crecdoc(idb)

the method works correctly

when it is called thru

crdoc->AddNew()

the statement which i underscored throw an atl string incorrect parameter exception as if it were unable to compute  the string final size [the getallocdata call in line 892 of ATLsimplstring.cpp 

what is impossible to understand is WHY ONLY this field has problems  and WHY only with addnew and not with the other call path

DOES ANYONE HAVE ANY IDEA ???

  



claudio cannella



Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>