|
birajendu wrote: I am building application for Win CE
It would help to specify all of your requirements in your initial post.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
just a guess, why would you want to do that anyway ?
|
|
|
|
|
i have to read some strings in run time from a .txt/.xls file...these files can be edited by user at any time with out altering the code.....
birajendu
CyberG India
Delhi
India
|
|
|
|
|
then, why reimporting them in your resources ?
why just not using those files (.txt/.xls) as external resources ?
|
|
|
|
|
but i think searching from .txt/.xls file for each string will take more time....and i have tons of strings to store...
birajendu
CyberG India
Delhi
India
|
|
|
|
|
and how do you work with your resource string tables ?
do the external files having always the same number of string (never new ones) ?
or is it possible that some strings can be added/removed ?
|
|
|
|
|
It is possible to add /remove strings..
or can u suggest any other simple scheme for this kinda of need...
birajendu
CyberG India
Delhi
India
|
|
|
|
|
birajendu wrote: or can u suggest any other simple scheme for this kinda of need...
not really, but i was just curious, as it seemed to me that reading files directly could be more simple. but i may be wrong...
|
|
|
|
|
You do not search at runtime, you bring them all into memory at startup. Even if you had 32767 strings with a length of 64 each, that would only require 2MB of memory - not a lot in today's world especially when it is only needs to be managed once at startup and once at shutdown.
If you design the file correctly, each string has a specific index, you store offsets into the file for each index, place the index at the start of the file, and you store the strings with their terminating NUL characters.
So at startup, you memory-map the strings file, read the index to determine the start of each (indexed) string, and since it contains its terminating NUL, you can use normal string-handling code to copy the strings where needed for display just by starting the copy operation from its offset using the address of the view of the MM file.
This would require a separate app to edit the strings file, but it would be worth it, IMHO.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
this is the method wat i am already using...i have only less them 1mb of string...but though i am using in Window CE reading this much of data also seems to slow..
birajendu
CyberG India
Delhi
India
|
|
|
|
|
Then details of the indexing used (how you locate specific strings in the file), copy methods used (how you get the string from file to memory), and the flags used when you open the file (can you MMap on CE) would be helpful.
Also, please define the performance you are looking for, and what you mean by "too slow". If it is taking 250ms to load and show a string, that may be OK for a CE device. Taking 5 seconds is not.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hello,
I use C++ in Visual Studio 98, and I have a question about the behavior of the interface.
I don't understand why for some home C++ projects, the available methods are shown when I type the name of an object, and for others home C++ projects nothing is shown.
Here is an example of what i'm expecting :
http://img248.imageshack.us/my.php?image=examplefa0.jpg
Do you know how to enable this feature in VSC++98 ?
Thanks,
Fred
|
|
|
|
|
ahhh, the misteries of IntelliSense
Ctrl+SpaceBar should solve your problem, unless your function is out of the current scope...
|
|
|
|
|
Delete the project's temporary files such as .ncb, .clw, .aps, .opt, .plg, etc. Open the project again and those that are necessary will get rebuilt.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Visual C++ 6.0 only processes files that are actually part of the project. The resulting IntelliSense information is placed in an .ncb file to save startup costs. In addition, VC uses a few pre-parsed .ncb files installed with Visual Studio (CRT.NCB, MFCATL.NCB, WIN32.NCB) for libraries supplied with it, and the Windows headers that came with VS6. The Windows IntelliSense information is now rather out of date.
I believe this problem continued in VS 2002 and 2003. VS2005 now actually processes included headers, so the information reflects the actual state of the source code.
Anyway, to get the methods of an object included, you need to include the corresponding header file in your project.
Visual Studio 6.0 also seems to have some threading gremlins which can cause the popup not to display, even though the status bar says 'Type the character following...' (or whatever the message is, I can't recall at the moment) as it normally does when the method picker is displayed.
|
|
|
|
|
hi all,
Is there any way to convert the existing code(Vc++) to a webbased program??
swaroop
|
|
|
|
|
You could probably convert it to an ActiveX control.
|
|
|
|
|
GAK!
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
My advice is to do it right, and (assuming you're writing a .Net 2.0 site) convert it manually to C#. If you're even halfway talented as a programmer, this shouldn't be a hard task.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: If you're even halfway talented as a programmer, this shouldn't be a hard task.
Nice Quote!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Hi all,
What function can I use to get a hold of all sub-direcories (of a certain directory)
Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
You need to use FindFirstFile(), FindNextFile() recursively.
Something like (pseudo code only):
void Recursive(std::string startingFolder)
{
found = FindFirstFile(startingFolder\*.*)
if(found)
{
do
{
if((folder.attributes & FOLDER) && (folder != '.') && (folder != '..'))
Recursive(folder);
cout << "FolderName: " << folder << "\r\n";
}
FindNextFile()
}
}
regards,
|
|
|
|
|
|
Programm3r wrote: does not comply with the functions standard ?
Hence why I said it was only pseudocode and not C++
What you need to do with this line is once you know a folders name, you append "\*.*" to it and pass that back to the recursive function so that it starts it's search from that location.
so using a std::string and C++ for example, the code becomes something like this (may not compile, but should be close enough):
void Delete::Recursive(const string szPath, const string szFileSpec)
{
WIN32_FIND_DATA obFindData;
memset(&obFindData, 0, sizeof(WIN32_FIND_DATA));
string searchPath;
const HANDLE hFind = FindFirstFile((szPath + _T("*.*")).c_str(), &obFindData);
if(hFind != INVALID_HANDLE_VALUE)
{
do
{
if(obFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if((_tcsicmp(obFindData.cFileName, ".") != 0) && (_tcsicmp(obFindData.cFileName, "..") != 0))
{
const string szFolderName = szPath + obFindData.cFileName + _T("\\");
Recursive(szFolderName, szFileSpec);
cout << szFolderName;
}
}
}
while(FindNextFile(hFind, &obFindData) != FALSE);
FindClose(hFind);
}
and you call it like this:
Recursive("c:\\", "*.*");
Hope that's a bit more obvious.
Note: This is a severely truncated version of some code I wrote a while ago, I have removed everything you do not need, but it may not compile as is, but should give you a clue anyway.
regards,
|
|
|
|
|