Hi, i have a popup menu for contextmenu.And i wrote the function for each menu in CMainframe.
I have OnContextMenu() in each view class and in one dialog class.Its works fine in Dialog class.But not in View class.Codings are below:
I need to turn strings into numbers ASAP, but I'm not sure I've gone about it the right way.
I'm calling into a 3rd party DLL which returns me a load of numbers as text. The text is actually a very basic XML. If I parse the XML, I can tell how many numbers are in the text.
The XML only has 2 elements, so I can parse it myself, but since I use XML in other places as well, I've incorporated MSXML to deal with the XML.
So I get a char* pchValue[PRESET_NUMBER] back from the 3rd party DLL which I turn into a CString for easy handling. It goes through several classes and across a thread or two before ending up in the number crunching class.
Here, I use MSXML to parse the XML. But the bulk of the information is still in a block of text. So I have to loop through it whilst looking for delimiters using CString::Find(). I chop up the string using CString::Mid(int,int) then use atoi(char*) to get each value which I pile into a member variable char*.
The question is this: is there a quicker and not so complicated way to do this?
Things that worry me are:
MSXML uses a lot of BSTR, so I'm calling a lot of CString::AllocSysString() and FreeSysString(BSTR).
CString probably isn't the fastest way to work with strings.
But, functions like CString::Find() and CString::Mid(int,int) make my life very easy. I wouldn't know where to start if I couldn't use CString.
I use atoi to convert text into numbers, but from what I can tell this is as fast as you can do that.
So has anyone got any ideas to speed this up without making it too complicated?
Is the way I'm doing this significantly slower than other methods?
i m reading data of csv file in a char buffer like this
and then saving changes before closing application in this way.
problem is that at first exec buffer holds data of all the file but after closing and re exec buffer contains only one character of file even though file contains same data after updation.wat can be the problem may b?