|
Ok already posted the code the problem occur in the moment i call Update, and when the file is greater than 255kb
|
|
|
|
|
So have you stepped into Update() , using the debugger, to see where the exception is being thrown from?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Have you verified that GlobalAlloc actually worked? Does file.Read() actually read the full file? Check the return value of the Read function to see how many bytes have been read.
255K doesn't seem that large. However, the Global** functions and the CFile class are ancient, and I wouldn't be surprised if they had some built-in restrictions...
On a sidenote, since you immediately lock the memory after allocation, why do you use GMEM_MOVEABLE ? And since you immediately free the memory after use, why do you even use the GLOBAL** functions at all, why don't you simply use new and delete instead? That would be faster, requires less code, and takes less effort to read and understand the code!
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Stefan_Lang wrote: why
Stefan_Lang wrote: why do you
Stefan_Lang wrote: why don't you Copy & Paste ?
|
|
|
|
|
Hi,
Drakelor wrote: 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. ..."
You are probably storing the file into a BLOB column. All SQL columns usually have a maximum size. The error message is probably correct... if you attempt to stuff 256 KBytes into a 255 KByte data field you will obviously get an error.
I suspect that you need to regenerate your database tables. This time choose a larger column size.
Best Wishes,
-David Delaune
|
|
|
|
|
I finally resolved the issue. I explain to you.
1) Download last SQL server driver.
2) Rebind/Recreate the CRecordset, so it bind with varbinary(max) -> CBYTEARRAY
3) In Recordset Class in the line : RFX_Binary(pFX, _T("[FileData]"), m_FileData,15360000);
increase the last parameter to desidered max dimension (15MB in my case).
4) Write this simple code:
CFile cfFileToSave(szPathFileToOpen,CFile::modeRead);
rsAttachments.m_FileData.SetSize((INT_PTR)cfFileToSave.GetLength());
cfFileToSave.Read(rsAttachments.m_FileData.GetData(),(UINT)cfFileToSave.GetLength());
cfFileToSave.Close();
rsAttachments.SetFieldDirty(&rsAttachments.m_FileData,TRUE);
rsAttachments.SetFieldNull(&rsAttachments.m_FileData,FALSE);
rsAttachments.Update();
All done thanks all
|
|
|
|
|
i've problem within doing my final project, i've a project where the project can be transfer a image continues and real time. the transfer data using UDp SOcket. any referention for me to build it, i don.t know what must i do
|
|
|
|
|
|
Irwan Saifranto wrote: i don.t know what must i do A few possibilities come to mind.
- Choose a different subject, one that you do understand.
- Research the use of UDP sockets, and how to write your own data management protocol.
- Switch to TCP and research some of the many samples available on the internet.
|
|
|
|
|
Hi!
i am New Programmer of C++. please tell me how to Use Vector In Template With Return Type.Give Me Any Example With Detail Which Can Help Me In Understanding Of This Problem.
|
|
|
|
|
Member 11004573 wrote: how to Use Vector In Template With Return Type. You need to be clearer about what you mean by this. There are many samples of vectors, templates and return types to be found on MSDN[^], CodeProject articles and through Google. However, if you have a specific coding issue then please show your code and expalin what errors you have.
|
|
|
|
|
e.g.
template <typename T> T find_max(const vector <T> & v)
{
}
However, as pointed out by Richard, there are many, many possibilities, without further details cannot help more.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
I have to ask: why is it that Richard is leanings sideways in your response? Are you implying he's drunk?
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Yes, Stephan
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
I have a prn file which prints bar-code. How can change the barcode value through File IO streams in VC++ 6.0
Kindly help me.
|
|
|
|
|
Can you tell what effort you put do this till now?
|
|
|
|
|
|
In order to replace content you have to recognize it. That is you have to write a (possibly simple) parser for the PRN file you are dealing with.
If the specifications of such PRN format are available then check them out, otherwise you have to (if possible) reverse engineer it.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
1. google for barcode reader source code
2. google for barcode printing source code
3. feed the former with your .prn file and get the code it represents
4. feed that to the latter to generate a new .prn file.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Hello Everyone!
Please Tell Me How To CONTROL KEYBOARD ARROW key and Move Any Object Through Keys in C++,Please Tell Me If Any One Have Knowledge Abut this.
|
|
|
|
|
Add some code to handle keyboard input[^] and adjust your object's position depending on which key is pressed.
|
|
|
|
|
Member 11004573 wrote: Please Tell Me How To CONTROL KEYBOARD ARROW key... Are you wanting to "click" the arrow keys programmatically, or are you wanting to handle key clicks?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I saw this code snippet on a web page that was talking about CUDA[^] cores:
Does anyone know the meaning of the syntax on the third line where they call the kernel function with those greater-than and less-than signs?
dim3 blockDim(16, 16, 1);
dim3 gridDim((width + blockDim.x - 1)/ blockDim.x, (height + blockDim.y - 1) / blockDim.y, 1);
kernel<<< gridDim, blockDim, 0 >>>(d_data, height, width);
cudaUnbindTexture(tex);
}
__global__ void kernel(float* odata, int height, int width)
{
unsigned int x = blockIdx.x*blockDim.x + threadIdx.x;
unsigned int y = blockIdx.y*blockDim.y + threadIdx.y;
if (x < width && y < height) {
float c = tex2D(tex, x, y);
odata[y*width+x] = c;
}
}
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
It is an extension of the NVIDIA CUDA compiler (see "Introduction to CUDA C"[^]: Triple angle brackets mark a call from host code to device code
— Sometimes called a “kernel launch”
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
Thank you.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|