|
I am sure that calculation will not take much time.
|
|
|
|
|
OK. I'm sure the CArray , properly used, is a efficient container.
Now, if both of us are right, your application has an intrinsic, insurmountable speed limit.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
After any allocation and filling of the array, you could use the member function GetData () to get at the actual doubles - then you can treat them as a double * , or classic C array.
If *that* is still slow, then the problem is not CArray.
As I'm fairly sure that the [] operator of CArray is an inline, you're probably already as fast as you'll get.
Iain.
|
|
|
|
|
|
Supriya Tonape wrote: Any pointers are appreciated.
Sure, why not. That's what we do here at CodeProject we supply Google Search's[^] for those who can't do it themselves.
led mike
|
|
|
|
|
how to Create,copy,remove,delete the folder using in mfc code.
am using a msdos command in mfc ,its wrking but appear a command prompt window.
|
|
|
|
|
com'on man... see mkdir function in MSDN help.. it will give a clue.
|
|
|
|
|
thanx for replay,
yes am using the same concept(mkdir,xcopy,rmdir) but the command prompt is appear in my application . i want to hide the prompt window how.
|
|
|
|
|
mathy wrote: yes am using the same concept(mkdir,xcopy,rmdir)...
But why? Those are old, command prompt operations. Use the Win32 API for such tasks. See here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Also look for SHFileOperation .
Moving / deleting a directory is more work than you probably think.
There are articles using the API here on codeproject, and some msdn articles too.
Iain,
|
|
|
|
|
thanx,
if u able to give any sample code to this for any one.
|
|
|
|
|
Nope, not able. I will point you to the search box at the top of the forum, as this is not the first time this question has been asked in october...
Iain.
|
|
|
|
|
Hi all,
I am using strcpy function to copy strings, but its giving a error error C2664: 'strcpy' : cannot convert parameter 2 from 'CString' to 'const char *'. i tried it using sprintf function but its also not working...
How can i do it. thanks in advance
|
|
|
|
|
If you are using VC6, the project won't be unicode by default, and CString has an implicit conversion to LPCTSTR, which would be const char * .
For later versions (which are unicode by default), that would be an implicit conversion to const wchar_t * .
Try using lstrcpy - it will switch between char and wchar_t automatically. If you change your char string to a TCHAR one, things will carry on nicely.
If this is all making you go "huh?", then you need a good google search on TCHAR, and do a bunch of reading.
Iain.
|
|
|
|
|
try this
CString mystring("bla bla");
mystring.GetBuffer() -> gives the pointer of buffer
try to copy this one..
|
|
|
|
|
dehseth wrote: mystring.GetBuffer()
That's the worst thing you could have suggested ! Did you read the documentation about this function ?
Anyway, if the cast operator doesn't work, the GetBuffer function won't work neither.
|
|
|
|
|
well i have used it all the time...
and it's bad because?
|
|
|
|
|
You have used it all the time: that's not a good reason to go suggest it to everyone on the internet.
dehseth wrote: and it's bad because?
http://vcfaq.mvps.org/mfc/9.htm[^] plus, read the doc about this function.
[Add] Cedric has said it far better. [/Add]
It is a crappy thing, but it's life -^ Carlo Pallini
modified on Tuesday, October 21, 2008 7:07 AM
|
|
|
|
|
But VCProgrammer wants to save it to another location..
If he is using one thread he can get buffer and copy and that's no harm at all.
He wants to use strcpy function to copy the content of CString to another location, and he can do it by getting the buffer pointer. After copying contents it's no more he's concern about the CString's buffer.
I do not suggest to get buffer pointer and store it and use it. That'd have been really wrong.
As I said I do this in a common DLL I ahve written and use it all my app, and still don't have any problem about losing strings or crashing any application..
|
|
|
|
|
dehseth wrote:
I do not suggest to get buffer pointer...and use it.
Actually you did.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
dehseth wrote: and it's bad because?
Read the function documentation, you'll see why it is very bad to use it without knowing what it does.
EDIT: by the way, the GetBuffer returns a LPTSTR and the CString supports a cast operator to a TCHAR string also. So, if the conversion to a char* is not 'automatic', using GetBuffer won't solve the problem.
For more info, reaf the article I suggested in my other post.
modified on Tuesday, October 21, 2008 7:03 AM
|
|
|
|
|
dehseth wrote: GetBuffer()
GOD, another one who doesn't know what he's talking about !!!
|
|
|
|
|
As usual, a link to the must read article[^]
|
|
|
|
|
|
thanx for articles guys..
|
|
|
|