|
what do you want to store in it ?
BTW, in C++, prefer STL to C file handling functions (std::fstream )
|
|
|
|
|
CreateFile() do create a binary file.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi all,
I neeed to read a total of 1500000 bytes via USB.
I need to create a buffer that would receive these USB databytes.
But if I create a buffer to be of more than 60000 bytes wide , I get "stack overflow error".
How do I receive all the bytes/sample points via USB?
Thanks in advance.
|
|
|
|
|
The problem has probably nothing to do with the USB. Post some relevant code so that we can see what you are doing.
|
|
|
|
|
Yes, I think so too.
well,
I use the USB read function FT_Read to read the USB contents which are continuous data of 1500000 bytes.
I need to read them all and hten plot them.
Hence the buffer that is used to read the USB data has to be big enough to receive and store the 15000000bytes in a temp buffer for other operations.
but if the buffer is declared to be rec_buf[Total_num_bytes_to_read]
if the Total_num_bytes_to_read is declared as 64,000 or more the program fails and stays there was an overflow in the stack.
|
|
|
|
|
By declaring rec_buf as a char[] you are putting it onto the stack, which has a limited size. You need to allocate it using the new operator:
char *rec_buf=new char[Total_num_bytes_to_read]
Don't forget to free the memory when you're done with it:
delete [] rec_buf;
|
|
|
|
|
Hi All,
In my project I want to show some statistical data in the graph format. for example the way we can see the line graph in the MS Excel.
In my project I have the x-Axis and Y-axis values stored in to the two dimentional array. I want to show this statastics on the graph in my dialog based application in VC++ 6.0.
can any body please suggest me any free library or code that I can use for the above purpose.
Thanks in Advance.
Dinesh
-- modified at 3:39 Monday 21st August, 2006
|
|
|
|
|
I developped a chart control that does what you are looking for (as far as I can see).
Take a look at the link in my sig for the article about it.
-- modified at 3:51 Monday 21st August, 2006
There are other charting controls here[^] also
|
|
|
|
|
Dear Cédric Moonen,
thanks for the link , I went through the link and guess this is the code I was looking for.
I Will impliment it today in my project
regards,
Dinesh.
|
|
|
|
|
Hi Cédric Moonen,
The code you written is really helpful to me.
will you please tell how to change the color of the graph lines, because When I am applying new colors it is keeping the old color for the line.
Regards,
-DInesh.
|
|
|
|
|
Hi,
I am working with property sheets.My requirement is when I press the first tab(the first property page) all the controls should be in disabled state.This I can do by setting the "disable" property for each and every control.But my requirement is instead of setting the "disable" property for each and every control in every page,I must set the disabled property for all the controls at a time in that page.
To be more specific : suppose if there are 3 tabs.When I press the first tab all the items should be in disabled state.When I press the second tab all the items in that page should be in disabled state and so on.
Hope I am clear.
Thanks in advance.
Sandhya
|
|
|
|
|
Is there any problem using CPropertyPage::OnSetActive ?
|
|
|
|
|
Hi, in my application,when i opened my application i have to enter in tot that by using username.After i closed the application it will create a bacttrack file with the details of user name and timings.For each entry it will write the details in file.And i will show this details in my dialog in ListControl.It reads the details from file and displayed it.Its working fine.But my problem is when the same user entered in to application the file should write all the users.But ListControl shows only the new user.I mean if "A" entered first time and if he enterd second time the ListControl should shows only the updated timings that is last entry only.How can i do this?
Anu
|
|
|
|
|
can you show code, how you are reading from file ?
|
|
|
|
|
You want a name and a detail of each user
for example user1 1:20 user1 1:22 user1 1:23
but in the listbox you want last time of user user1 1:23,right?
|
|
|
|
|
yes, I want to update already entry user.My code is
void CLogFileInfo::UpdateListCtrl()
{
FILE *fpLogInfo;
Fname=_T("");
Instr=_T("");
ModelPeriod=_T("");
Model=_T("");
sno=1;
cnt=1;
char Sno[10];
CString GlbFNamePath2;
char LogList[200];
pCtrl->DeleteAllItems();
GlbFNamePath2 = gsInstallPath + "\\Esim\\sys\\" + "LogInfo.txt";
if ((fpLogInfo=fopen((LPCTSTR)GlbFNamePath2, "r"))!=NULL)
{
while(fgets(LogList,100,fpLogInfo)!=NULL)
{
RowIndex=sno-1;
sprintf(Sno,"%d",sno);
ReadStr =LogList;
ReadStr.TrimRight();
if (cnt==1)
Fname=ReadStr;
if (cnt==2)
Instr=ReadStr;
if (cnt==3)
Traine=ReadStr;
if (cnt==4)
ModelName=ReadStr;
if (cnt==5)
Model=ReadStr;
if(cnt>=5)
{
Index=pCtrl->InsertItem(RowIndex,Sno);
pCtrl->SetItemText(Index,1,Fname);//"LogFile" or "LogFIle_username"
pCtrl->SetItemText(Index,2,Instr);//Instructor name
pCtrl->SetItemText(Index,3,Traine);//Trainee name
pCtrl->SetItemText(Index,4,ModelPeriod);//2 hours
pCtrl->SetItemText(Index,5,Model);//Boiler or Suction...
cnt=1;
sno+=1;
newsno=sno;
}
else
{
cnt=cnt+1;
}
}
fclose(fpLogInfo);
}
}
In this coding it list all entries in to ListControl..
Here FName is for users entry identification.Common users entry with just "LogFile" FName and some registered people enter with "LogFile_username"... i want to replace the LogFile entry at each entry and LogFile_username is entered as it is ..ok I hope u get my points
Anu
|
|
|
|
|
well for this purpose when you want to insert a value to exist values first check is this value exist in this file
or no if yes then you can overwrite exist value but i think your code has a problem if your file is 10MB and value is in the end file do you have any idea?
|
|
|
|
|
As known, we can use DeviceCapabilities with DC_PAPERS Retrieves a list of supported paper sizes. My question is: how do we retrieve the list of default page margins for each paper size?
This should be doable because the preview image inside the page setup dialog (eg in Notepad) displays different margins for different paper size selection.
I tried this approach but it didn't work:
(1) Use SetPrinter to change the paper size (see "Set up/change printer orientation and select paper type/size" By AlexEvans )
(2) Use GetDeviceCaps() with PHYSICALOFFSETX and PHYSICALOFFSETY to get left and top margins. But it didn't give me correct info (eg, it gives me 0 for A3 paper).
I really want to know how MFC's CPageSetupDialog is able to do that, but I haven't been able to find it out.
Thanks all for help!
|
|
|
|
|
Dear,
As i posted some days before, I want to use my program to copy files from a share folder in another computer in LAN. I tried to use the LogonUser() function but it worked only at localhost (127.0.0.1) with only current account. Please help me in this. I am using C non-MFC.
Thanks a lot.
-- modified at 5:08 Monday 21st August, 2006
Sincerely
Thangnvhl
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
Hi all,
I'm wondering if turning on the /GS- switch (that's the Buffer Security Check option, it's used to prevent Buffer Overrun) make the final binary code run slower?
Environment:
1.) In pure WIN32 with C++ code. (native apps)
2.) Release build.
3.) WinXP /w SP2.
Thanks.
|
|
|
|
|
Link2006 wrote: I'm wondering if turning on the /GS- switch (that's the Buffer Security Check option, it's used to prevent Buffer Overrun) make the final binary code run slower?
Compile with and without the switch and then investigate...
too much daily WTF for someone... - Anton AfanasyevLast modified: Monday, August 21, 2006 2:50:09 PM -- Did a test program and it made no difference in speed or size.
|
|
|
|
|
PaulC1972 wrote: Compile with and without the switch and then investigate...
I can't tell the difference, maybe that's because both of my machines are rather fast, and my low-end PC is installed with Linux, so I can't test it on that machine.
I'm going to leave that switch on for now.
|
|
|
|
|
Did you notice the modification that I had to my post. I didn't find any difference between the two executables generated with and without the switch. Speed and size were the same. Running a diff between the two executables says they differ
too much daily WTF for someone... - Anton Afanasyev
|
|
|
|
|
PaulC1972 wrote: Did you notice the modification that I had to my post.
Nope, I didn't. The font is too small, I didn't notice it at first until you mentioned it.
|
|
|
|