Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Can't read certain registry keys Pin
Richard Andrew x6416-Aug-14 10:52
professionalRichard Andrew x6416-Aug-14 10:52 
QuestionUsing MFC Dev Studio 97 with VC++ 5.0 in Win7 Pin
Bram van Kampen15-Aug-14 14:09
Bram van Kampen15-Aug-14 14:09 
QuestionParsing in C/C++ Pin
Member 1012503214-Aug-14 16:57
Member 1012503214-Aug-14 16:57 
AnswerRe: Parsing in C/C++ Pin
Member 1012503214-Aug-14 18:42
Member 1012503214-Aug-14 18:42 
SuggestionRe: Parsing in C/C++ Pin
David Crow15-Aug-14 3:35
David Crow15-Aug-14 3:35 
AnswerRe: Parsing in C/C++ Pin
Richard MacCutchan14-Aug-14 21:12
mveRichard MacCutchan14-Aug-14 21:12 
AnswerRe: Parsing in C/C++ Pin
jschell15-Aug-14 9:24
jschell15-Aug-14 9:24 
QuestionCLongBinary Limited to 255 Bytes Pin
Drakesal13-Aug-14 21:52
Drakesal13-Aug-14 21:52 
Hi all

I am writing a program to submit some files in a SQL server 2012 the problem is:

when the file size is around 255 KBytes it's all ok, but when the file is greater there is an error on "RecordSet.Update() phase. The error is : "The Pointer Value type Text, NText or image conflicts with the specified column name. ..."

The Column is declared in table as varbinary(max) the code is:

CFile file(szPathFileToOpen, CFile::modeRead);
ULONGLONG filelen = file.GetLength();

        rsAttachments.AddNew();

rsAttachments.m_AttachmentsID=szUniqueID;

rsAttachments.m_FileName=m_ListAttached.GetItemText(0,0);

GlobalFree( rsAttachments.m_FileData.m_hData );

if((rsAttachments.m_FileData.m_hData=GlobalAlloc(GMEM_MOVEABLE,filelen))==NULL)
{
    AfxMessageBox(_T("memory error"));
}

LPVOID pVoid = NULL;
if((pVoid=GlobalLock(rsAttachments.m_FileData.m_hData))== NULL)
{
    AfxMessageBox( _T( "memory error" ));
}

file.Read(pVoid, filelen);

rsAttachments.SetFieldDirty( &rsAttachments.m_FileData, TRUE );
rsAttachments.SetFieldNull( &rsAttachments.m_FileData, FALSE );

rsAttachments.m_FileData.m_dwDataLength=GlobalSize(rsAttachments.m_FileData.m_hData );

        rsAttachments.Update();

GlobalFree( rsAttachments.m_FileData.m_hData );


Thanks in advance to the angel will help me.

Giovanni
QuestionRe: CLongBinary Limited to 255 Bytes Pin
Richard MacCutchan13-Aug-14 22:17
mveRichard MacCutchan13-Aug-14 22:17 
AnswerRe: CLongBinary Limited to 255 Bytes Pin
Drakesal13-Aug-14 22:39
Drakesal13-Aug-14 22:39 
GeneralRe: CLongBinary Limited to 255 Bytes Pin
Richard MacCutchan13-Aug-14 23:21
mveRichard MacCutchan13-Aug-14 23:21 
GeneralRe: CLongBinary Limited to 255 Bytes Pin
Drakesal13-Aug-14 23:24
Drakesal13-Aug-14 23:24 
QuestionRe: CLongBinary Limited to 255 Bytes Pin
David Crow15-Aug-14 3:37
David Crow15-Aug-14 3:37 
AnswerRe: CLongBinary Limited to 255 Bytes Pin
Stefan_Lang14-Aug-14 4:44
Stefan_Lang14-Aug-14 4:44 
GeneralRe: CLongBinary Limited to 255 Bytes Pin
Richard MacCutchan14-Aug-14 5:40
mveRichard MacCutchan14-Aug-14 5:40 
AnswerRe: CLongBinary Limited to 255 Bytes Pin
Randor 14-Aug-14 15:18
professional Randor 14-Aug-14 15:18 
GeneralRe: CLongBinary Limited to 255 Bytes Pin
Drakesal14-Aug-14 20:12
Drakesal14-Aug-14 20:12 
QuestionAutomatic Transfer File [Real-TIme] Pin
Irwan Saifranto13-Aug-14 12:02
Irwan Saifranto13-Aug-14 12:02 
AnswerRe: Automatic Transfer File [Real-TIme] Pin
CPallini13-Aug-14 21:18
mveCPallini13-Aug-14 21:18 
AnswerRe: Automatic Transfer File [Real-TIme] Pin
Richard MacCutchan13-Aug-14 22:14
mveRichard MacCutchan13-Aug-14 22:14 
QuestionC++ Vector Array in Template Pin
Member 1100457313-Aug-14 4:19
Member 1100457313-Aug-14 4:19 
SuggestionRe: C++ Vector Array in Template Pin
Richard MacCutchan13-Aug-14 4:55
mveRichard MacCutchan13-Aug-14 4:55 
AnswerRe: C++ Vector Array in Template Pin
CPallini13-Aug-14 8:45
mveCPallini13-Aug-14 8:45 
GeneralRe: C++ Vector Array in Template Pin
Stefan_Lang14-Aug-14 2:34
Stefan_Lang14-Aug-14 2:34 
GeneralRe: C++ Vector Array in Template Pin
CPallini14-Aug-14 2:40
mveCPallini14-Aug-14 2:40 

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.