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

C / C++ / MFC

 
GeneralRe: Sleep( ) Pin
Tim Smith8-Oct-01 15:06
Tim Smith8-Oct-01 15:06 
GeneralRe: Sleep( ) Pin
ColinDavies8-Oct-01 17:49
ColinDavies8-Oct-01 17:49 
GeneralXP UI Registry settings Pin
Tim Smith8-Oct-01 12:26
Tim Smith8-Oct-01 12:26 
GeneralRe: XP UI Registry settings Pin
Tomasz Sowinski8-Oct-01 23:34
Tomasz Sowinski8-Oct-01 23:34 
GeneralRe: XP UI Registry settings Pin
Tim Smith9-Oct-01 2:01
Tim Smith9-Oct-01 2:01 
GeneralWMI problem, Query too slow Pin
Bill Wilson8-Oct-01 11:48
Bill Wilson8-Oct-01 11:48 
GeneralQuestion: Registering a new Document Template Pin
8-Oct-01 11:42
suss8-Oct-01 11:42 
GeneralDrawing question Pin
8-Oct-01 11:24
suss8-Oct-01 11:24 
QuestionWhat is this ':'? Pin
Sam C8-Oct-01 10:58
Sam C8-Oct-01 10:58 
AnswerRe: What is this ':'? Pin
Chris Losinger8-Oct-01 11:09
professionalChris Losinger8-Oct-01 11:09 
GeneralRe: What is this ':'? Pin
Sam C8-Oct-01 12:14
Sam C8-Oct-01 12:14 
GeneralRe: What is this ':'? Pin
Chris Losinger8-Oct-01 12:32
professionalChris Losinger8-Oct-01 12:32 
GeneralRe: What is this ':'? Pin
Sam C8-Oct-01 13:09
Sam C8-Oct-01 13:09 
GeneralRe: What is this ':'? Pin
Chris Losinger8-Oct-01 15:29
professionalChris Losinger8-Oct-01 15:29 
GeneralRe: What is this ':'? Pin
Sam C8-Oct-01 16:23
Sam C8-Oct-01 16:23 
GeneralRe: What is this ':'? Pin
Chris Losinger9-Oct-01 1:31
professionalChris Losinger9-Oct-01 1:31 
GeneralRe: What is this ':'? Pin
Sam C9-Oct-01 3:51
Sam C9-Oct-01 3:51 
GeneralOLE drag and drop using MFC Pin
vgandhi8-Oct-01 10:45
vgandhi8-Oct-01 10:45 
GeneralSuperClass CListViewCtrl Pin
8-Oct-01 8:43
suss8-Oct-01 8:43 
GeneralRe: SuperClass CListViewCtrl Pin
Tomasz Sowinski8-Oct-01 8:53
Tomasz Sowinski8-Oct-01 8:53 
GeneralRe: SuperClass CListViewCtrl Pin
8-Oct-01 9:07
suss8-Oct-01 9:07 
GeneralRe: SuperClass CListViewCtrl Pin
Tomasz Sowinski8-Oct-01 9:17
Tomasz Sowinski8-Oct-01 9:17 
GeneralRe: SuperClass CListViewCtrl Pin
8-Oct-01 9:45
suss8-Oct-01 9:45 
GeneralADO question ... Pin
Hadi Rezaee8-Oct-01 8:31
Hadi Rezaee8-Oct-01 8:31 
GeneralRe: ADO question ... Pin
Brendan Tregear8-Oct-01 16:48
Brendan Tregear8-Oct-01 16:48 
The best way is to use BLOB data with the ADO stream object. Don't bother with GetChunk & SetChunk, it's a real pig to use. Here's a quick cut'n'paste from my code so its not exactly clear, but this is for loading blob data but you'll be able to easily change it to save blob data:

<br />
  //<br />
  // Reconstruct annotations from database<br />
  ///////////////////////////////////////////////////////////////////////////<br />
  _RecordsetPtr pAnnoRs = NULL;<br />
  _StreamPtr pStream = NULL;<br />
  CString strSQL;<br />
  _bstr_t strMissing(L"");<br />
  BOOL bEmpty = TRUE;<br />
<br />
  try<br />
  {<br />
		TESTHR(pAnnoRs.CreateInstance(__uuidof(Recordset)));<br />
		TESTHR(pStream.CreateInstance(__uuidof(Stream)));<br />
  		strSQL.Format(_T("SELECT `tblAnnotations`.* FROM `tblAnnotations` WHERE `tblAnnotations`.`imageID` = %d;"), nImageID);<br />
		TESTHR(pAnnoRs->Open( (_bstr_t) strSQL, _variant_t((IDispatch*) thisMainFrm.pConnection), adOpenKeyset, adLockOptimistic, adCmdTableDirect));<br />
		<br />
		if  (!pAnnoRs->GetadoEOF())<br />
		{<br />
		  TESTHR(pStream->Open(vtMissing, adModeUnknown, adOpenStreamUnspecified, strMissing, strMissing));<br />
		  TESTHR(pStream->put_Type(adTypeBinary));<br />
		  TESTHR(pStream->Write(pAnnoRs->Fields->GetItem(L"BLOB")->Value)); // This gets the blob data<br />
		  TESTHR(pStream->SaveToFile( (_bstr_t) strDir, adSaveCreateOverWrite)); //This will save the data to a file on the disk, in your case save as c:\myfile.bmp<br />
		  TESTHR(pAnnoRs->Close());<br />
		  TESTHR(pStream->Close());<br />
		  bEmpty = FALSE;<br />
		}<br />
  }<br />
  catch (_com_error &e)<br />
  {<br />
	TRACE(_T("COM error in CThumbBar::OnThumbCopyAndPaste()"));<br />
	TRACE(_T("Error:%081x.\n"), e.Error());<br />
	TRACE(_T("ErrorMessage:%s.\n"), e.ErrorMessage());<br />
	TRACE(_T("Source:%s.\n"), (LPCTSTR) _bstr_t(e.Source()));<br />
	TRACE(_T("Description:%s.\n"), (LPCSTR) _bstr_t(e.Description()));<br />
	return FALSE;<br />
  }<br />
  catch (int)<br />
  {<br />
	;<br />
  }<br />


good luck.

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.