|
Allocate buffer1 with new.
And don't forget to delete it, later.
|
|
|
|
|
rather than putting nfilelength in buffer1[] put some value say buffer1[512]
never say die
|
|
|
|
|
To specify an array with dynamic size, you should allocate it dynamically.
eg.
char* buffer1 = new char[nfilelength];
// read the file.
// do other thing that you need.
delete [] buffer1;
But I think there is a logical mistake in your code. You read only one char from the file using fread. If you intended to do so then you don't have to give any array.
If not you should specify the size as nfilelenght or sizeof(char)*nfilelength instead of sizeof(char).
- NS -
|
|
|
|
|
What is the difference between ItemExpanding and ItemExpanded in treeview ?
Thanks
|
|
|
|
|
pankajgarg12 wrote: What is the difference between ItemExpanding and ItemExpanded in treeview ?
MSDN has explained the difference quite nicely.
Nibu thomas
Software Developer
|
|
|
|
|
|
TVN_ITEMEXPANDING is sent before the expand/collapse happens, and gives you the chance to prevent the change. TVN_ITEMEXPANDED is sent after.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
IF i have a array which contains the color values then how to create a bit map using that array.
eg. unsigned char Arr[ROW][COL][3];
Arr contain Row*Col*RQuad valus;
then i create a BITMAPFILEHEADER, and BITMAPINFOHEADER
and these two a erite into a file, then i face aproblem how to write a color value in file so that .bmp file will generate.
Thanks in advance
Rahul here
|
|
|
|
|
these days I also concerned how to operate bitmap,I think you can down a bitmap operation project to learning,you can learn it frome the "Save as" menu respond function.Good luck!
|
|
|
|
|
Hi,
I am working with vc++. I need to write an excel file with the below format in VC++.
Events Table - 1st row
Description of table - 2nd row
Date&Time,Source,Cause,Description,Fault - 3rd row
Mar 13 2006 12:25:05.000078,HMI,H-0001,Startup,N
Mar 13 2006 12:25:05.000187,HMI,H-0005,Caution,Y
Basically the first row in the excel file must have the table heading, second row must have the table description and the third row will have the column names and fourth row onwards the actual data.
I am able to create an excel file if all the rows have the same number of columns.
But I am unable to create an excel file with different numberof columns in the rows as shown above.
I am using the CSpreadSheet class from codeproject website:
http://www.codeproject.com/database/cspreadsheet.asp
but this class is not allowing to write data in the above format..
Can anyone please help me to do this.
Thanks
Madhavi.
|
|
|
|
|
Just a thought, why don't you use 5 columns for all lines?
I.e:
Line 1: "Events Table", " ", " ", " ", " "
Line 2: "Description of table", " ", " ", " ", " "
Line 3: "Date&Time","Source","Cause","Description","Fault"
"If you can't beat them, join them"...
|
|
|
|
|
Hi,
I am working with vc++. I need to write an excel file with the below format in VC++.
Events Table - 1st row
Description of table - 2nd row
Date&Time,Source,Cause,Description,Fault - 3rd row
Mar 13 2006 12:25:05.000078,HMI,H-0001,Startup,N
Mar 13 2006 12:25:05.000187,HMI,H-0005,Caution,Y
Basically the first row in the excel file must have the table heading, second row must have the table description and the third row will have the column names and fourth row onwards the actual data.
I am able to create an excel file if all the rows have the same number of columns.
But I am unable to create an excel file with different numberof columns in the rows as shown above.
Can anyone please help me to do this.
Thanks
Madhavi.
|
|
|
|
|
When u say Excel file, do you mean a .xls file? How did you go about creating the excel file. Please post more details!
Have you tried using the Excel Object Model?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
I am using the CSpreadSheet class from codeproject website:
http://www.codeproject.com/database/cspreadsheet.asp
but this class is not allowing to write data in the above format..
|
|
|
|
|
LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /DRIVER specification
Thanks
|
|
|
|
|
Open project properties. In C/C++ section, change "Debug Information Format" to "Program Database."
In Link section, you may also want (need?) to change "Enable Incremental Linking" to "No"
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Its just a conflict between some of the complier flags you have. Nothing serious. I'm not too sure what the /DRIVER settings does, but the /EDITANDCONTINUE allows you to modify code while you're debugging.
I used to know where these settins were in the project options, but I cant seem to find them anymore. Sorry
|
|
|
|
|
Hi,
I have a problem regarding the message handling of Control Bar. I have a Control bar which is derived from CControlBar. This control bar has a Tree control inside it. The problem is that, iam not able to capture the changes in the tree item (selection cahnges). I used the like this:
I used this inside.... BEGIN_MESSAGE_MAP
ON_NOTIFY(TVN_SELCHANGING, 123, OnSelchangedTreectrl)
END_MESSAGE_MAP()
But whenever i chnange the selection inside my tree, there is no notification. But there is a notification for the context menu, which i used as:
ON_WM_CONTEXTMENU()
This contest menu message gets captured properly, but not the tree control changes.
Can anybody please help me in understanding this. i would be very much grateful, if someone can direct me to some code, which uses something like the one i have stated.
Thanks a lot in advance
thx,
KAB
|
|
|
|
|
Hello,
Sorry if this is a completely lame question, but is there a approach that allows info to be securely sent server->client->server such that only the client application, and no other application on the client's side, can intercept it? This would be useful in situations where the client application only wants certain parts of the incomming data to be available to the client's user, and can not assume the client is not peeking (monitoring incoming traffic).
Thanks,
KnaveWave
Oi! Oi! Oi!
|
|
|
|
|
What about encrypted data?
|
|
|
|
|
Couldnt an evil app on the client's side simply obtain the key and decrypt as well?
|
|
|
|
|
You don't HAVE to keep the key in a readable state in the client. You can do a simple encryption of the key within the client. (XOR, bit shift or some other way).
Then decrypt the key whenever you need it. When there is no need for the key, overwrite the used key buffer with random characters, and delete it.
That way, the key will exist in plain text for a very short amount of time.
Just a thought, maybe you can decode the key witin a CriticalSection block?
Will a CriticalSection stop other apps from executing? I'm not sure.
|
|
|
|
|
Go for Digital Certificate
never say die
|
|
|
|
|
Regarding your user name:
Any connection to "Knaverlisa" ?
|
|
|
|
|
Hi all,
I would like to know how do I destroy the IDispatch pointer if I have used it in my code.
Can I do something like LPDISPATCH lpRai = NULL ; Will this destroy the pointer and the value whose address it is holding? How do I destroy the value so that no memory leaks happen?
Also supposing I declare a class like CMyClass myClass ; does myClass = NULL destroy the variable?
Thanks for all your time.
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|