Click here to Skip to main content
15,889,859 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: webbrowser problem Pin
Cedric Moonen1-Apr-10 21:11
Cedric Moonen1-Apr-10 21:11 
GeneralRe: webbrowser problem Pin
Aric Wang1-Apr-10 21:27
Aric Wang1-Apr-10 21:27 
GeneralRe: webbrowser problem Pin
Aric Wang1-Apr-10 21:33
Aric Wang1-Apr-10 21:33 
GeneralRe: webbrowser problem Pin
Eugen Podsypalnikov1-Apr-10 21:44
Eugen Podsypalnikov1-Apr-10 21:44 
GeneralRe: webbrowser problem Pin
Aric Wang4-Apr-10 0:45
Aric Wang4-Apr-10 0:45 
QuestionOnContextMenu not working in View class Pin
Anu_Bala1-Apr-10 20:46
Anu_Bala1-Apr-10 20:46 
AnswerRe: OnContextMenu not working in View class Pin
Eugen Podsypalnikov1-Apr-10 21:25
Eugen Podsypalnikov1-Apr-10 21:25 
QuestionProcessing strings ASAP Pin
PaulowniaK1-Apr-10 20:02
PaulowniaK1-Apr-10 20:02 
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.

The content of pchValue looks like
<MyXMLNode>
0
1
<MyChildNode N="10">
0 1 2 3 4 5 6 7 8 9
</MyChildNode>
</MyXMLNode>


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?

Thanks...
Almost, but not quite, entirely unlike... me...

QuestionRe: Processing strings ASAP Pin
CPallini1-Apr-10 21:21
mveCPallini1-Apr-10 21:21 
AnswerRe: Processing strings ASAP Pin
PaulowniaK1-Apr-10 21:32
PaulowniaK1-Apr-10 21:32 
GeneralRe: Processing strings ASAP Pin
CPallini1-Apr-10 21:48
mveCPallini1-Apr-10 21:48 
GeneralRe: Processing strings ASAP Pin
PaulowniaK1-Apr-10 22:03
PaulowniaK1-Apr-10 22:03 
GeneralRe: Processing strings ASAP Pin
CPallini1-Apr-10 22:16
mveCPallini1-Apr-10 22:16 
GeneralRe: Processing strings ASAP Pin
PaulowniaK4-Apr-10 14:20
PaulowniaK4-Apr-10 14:20 
GeneralRe: Processing strings ASAP Pin
CPallini5-Apr-10 0:09
mveCPallini5-Apr-10 0:09 
Questioncsv file problem Pin
Member 5903101-Apr-10 19:29
Member 5903101-Apr-10 19:29 
AnswerRe: csv file problem Pin
Eugen Podsypalnikov1-Apr-10 19:45
Eugen Podsypalnikov1-Apr-10 19:45 
GeneralRe: csv file problem Pin
Member 5903101-Apr-10 20:01
Member 5903101-Apr-10 20:01 
GeneralRe: csv file problem Pin
Eugen Podsypalnikov1-Apr-10 20:12
Eugen Podsypalnikov1-Apr-10 20:12 
GeneralRe: csv file problem Pin
Member 5903101-Apr-10 20:31
Member 5903101-Apr-10 20:31 
GeneralRe: csv file problem Pin
Eugen Podsypalnikov1-Apr-10 20:35
Eugen Podsypalnikov1-Apr-10 20:35 
GeneralRe: csv file problem Pin
Member 5903101-Apr-10 20:45
Member 5903101-Apr-10 20:45 
GeneralRe: csv file problem Pin
Eugen Podsypalnikov1-Apr-10 20:53
Eugen Podsypalnikov1-Apr-10 20:53 
GeneralRe: csv file problem Pin
Member 5903101-Apr-10 20:59
Member 5903101-Apr-10 20:59 
GeneralRe: csv file problem Pin
Eugen Podsypalnikov1-Apr-10 21:03
Eugen Podsypalnikov1-Apr-10 21:03 

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.