Click here to Skip to main content
15,914,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Static object in mfc, only one instance for all instance of my class Pin
Remi Morin17-Sep-01 4:58
Remi Morin17-Sep-01 4:58 
GeneralTell me the difference :) Pin
17-Sep-01 4:40
suss17-Sep-01 4:40 
GeneralRe: Tell me the difference :) Pin
Remi Morin17-Sep-01 5:09
Remi Morin17-Sep-01 5:09 
GeneralRe: Tell me the difference :) Pin
Remi Morin17-Sep-01 5:29
Remi Morin17-Sep-01 5:29 
GeneralRe: Tell me the difference :) Pin
Remi Morin17-Sep-01 6:02
Remi Morin17-Sep-01 6:02 
GeneralCorrection: Tell me the difference :) Pin
17-Sep-01 22:28
suss17-Sep-01 22:28 
GeneralRe: Tell me the difference :) Pin
Alvaro Mendez18-Sep-01 10:42
Alvaro Mendez18-Sep-01 10:42 
GeneralAbsolute bloody ADO hell Pin
Christian Graus17-Sep-01 3:55
protectorChristian Graus17-Sep-01 3:55 
With thanks to Michael Butler, I've figured out where my ATL project is dying. I have added four fields to my database. They are being populated correctly. Previously, retrieved my values like this:

	_RecordsetPtr records = NULL;
	 records.CreateInstance(__uuidof(Recordset));

	try
	{
		records->CursorType = adOpenStatic;
		records->CursorLocation = adUseClient;
		records->Open("SELECT * FROM FileDatabase",
		_variant_t((IDispatch*)m_Connection, true), adOpenKeyset, adLockOptimistic, 
		adCmdUnknown);
	}
	catch(...)//_com_error & e)
	{
//		MessageBox(NULL, e.ErrorMessage(), "", 0);
	}

	records->MoveFirst();

	vector<ISAFileEntry*> vecDatabase;
	
	do
	{
        	CComObject<CSAFileEntry>* pFileEntry = NULL;

		CComObject<CSAFileEntry>::CreateInstance(&pFileEntry);

		if (pFileEntry)
		{
			FieldsPtr spFields = records->GetFields();

			string s = (bstr_t) spFields->Item["FileName"]->Value;
			for (string::iterator it = s.begin(); it != s.end(); ++it)
				 if (*it == '?') *it = '\'';
			pFileEntry->m_FileName = s.c_str();
			pFileEntry->m_FileLength = spFields->Item["FileLength"];
			pFileEntry->m_DownloadCount = spFields->Item["TimesDownloaded"];
			pFileEntry->m_LastModified = spFields->Item["LastModified"];


but since adding four more fields, I find all my numeric values are being read a 0, although Access show me real values have been stored.

Changing to this:

string s = (bstr_t) spFields->Item["FileName"]->Value;
for (string::iterator it = s.begin(); it != s.end(); ++it)
     if (*it == '?') *it = '\'';
pFileEntry->m_FileName = s.c_str();
pFileEntry->m_FileLength = spFields->Item["FileLength"]->Value;
pFileEntry->m_DownloadCount = spFields->Item["TimesDownloaded"]->Value;
pFileEntry->m_LastModified = spFields->Item["LastModified"]->Value;
pFileEntry->m_Frames = spFields->Item["Frames"];
pFileEntry->m_Seconds = spFields->Item["Seconds"];
pFileEntry->m_Width = spFields->Item["Width"];
pFileEntry->m_Height = spFields->Item["Height"];


Works for my old values ( I added ->Value to them ), but my new values are still 1, and if I add ->Value to them, it crashes in the first iteration. Can anyone suggest what might be the problem ?


Christian

As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.

Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
GeneralRe: Absolute bloody ADO hell Pin
Michael P Butler17-Sep-01 4:01
Michael P Butler17-Sep-01 4:01 
GeneralRe: Absolute bloody ADO hell Pin
Christian Graus17-Sep-01 4:06
protectorChristian Graus17-Sep-01 4:06 
GeneralRe: Absolute bloody ADO hell Pin
Michael P Butler17-Sep-01 4:27
Michael P Butler17-Sep-01 4:27 
GeneralRe: Absolute bloody ADO hell Pin
Christian Graus17-Sep-01 4:27
protectorChristian Graus17-Sep-01 4:27 
GeneralRe: Absolute bloody ADO hell Pin
Michael P Butler17-Sep-01 4:35
Michael P Butler17-Sep-01 4:35 
GeneralRe: Absolute bloody ADO hell Pin
Jeremy Pullicino17-Sep-01 5:29
Jeremy Pullicino17-Sep-01 5:29 
GeneralRe: Absolute bloody ADO hell Pin
Christian Graus17-Sep-01 13:00
protectorChristian Graus17-Sep-01 13:00 
GeneralAbsolute bloody ATL hell Pin
Christian Graus17-Sep-01 2:12
protectorChristian Graus17-Sep-01 2:12 
GeneralRe: Absolute bloody ATL hell Pin
Michael P Butler17-Sep-01 2:35
Michael P Butler17-Sep-01 2:35 
GeneralRe: Absolute bloody ATL hell Pin
Christian Graus17-Sep-01 2:51
protectorChristian Graus17-Sep-01 2:51 
GeneralRe: Absolute bloody ATL hell Pin
Michael P Butler17-Sep-01 3:02
Michael P Butler17-Sep-01 3:02 
GeneralRe: Absolute bloody ATL hell Pin
Christian Graus17-Sep-01 3:10
protectorChristian Graus17-Sep-01 3:10 
GeneralRe: Absolute bloody ATL hell Pin
Michael P Butler17-Sep-01 3:15
Michael P Butler17-Sep-01 3:15 
GeneralRe: Absolute bloody ATL hell Pin
Christian Graus17-Sep-01 3:30
protectorChristian Graus17-Sep-01 3:30 
GeneralHandling Button's Events Pin
MAAK17-Sep-01 1:26
MAAK17-Sep-01 1:26 
GeneralRe: Handling Button's Events Pin
Michael P Butler17-Sep-01 2:01
Michael P Butler17-Sep-01 2:01 
QuestionHow do I find out what workgroup/domain a host is in? Pin
Paul Vickery17-Sep-01 0:37
professionalPaul Vickery17-Sep-01 0:37 

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.