|
You IntelliSense is screwed. Try deleting .ncb and .opt files from your project directory and then you may see the code line which point to your exception code.
|
|
|
|
|
I just did this:
1. Deleted the .ncb file
2. Deleted the .suo file
3. Deleted the folder "DebugUnicode" (this is the folder for my DebugUnicode build of this project which contains all the intermediate files such as .obj files, and the final .exe file for this project.)
4. Deleted the user options file (.user)
After those, the only files I have in the project are
The .sln file
The .rc file
The .vcproj file
The .h files
The .cpp files
and the two files from sqlite.org: sqlite3.h and sqlite3.c
However, after relaunching VS2005 and the project, it still breaks on that comment line!
Any other suggestions? Thanks!
|
|
|
|
|
Does it breaks in your code or sqlite3.c? Why don;t you single step in your code and then check calls made to functions in sqlite3.c, BTW are you running debug or release version?
Regards
Abhi
|
|
|
|
|
It breaks in sqlite3.c. I am running the debug version. I will set break points on calls to sqlite functions and try to find out what is happening. I can find the problems that way, which involves a little bit more hassle. I am just annoyed by the strange behavior of VS2005.
Thanks for your help!
|
|
|
|
|
Can you simplify the function by #define or something else?
I want to simplify code bellow, both dll and dynamically reading file are not suitable because of 2 reasons:
1. those files are created by others, if in my way, I only need to re-compile, and do not need to copy the 150 files (will be more soon) into code.
2. there are around 3K of words and sentences in different languages, which can not be used by index. i.e. for string "Apply now", we can not use
CString cs=data[1743]+data[725] - no one can remember which index is which word.
there is a definition class (generated from Data file), looks like:
class Data
{
WORD
*Time,
....,
*Now,
....,
*Apply,
....
};
use is one of #include bellow, then
CString cs=data.Apply+data.Now;
is OK.
void LangData::P_InitLangFull()
{
char*p0[]=
{
#include "Language\english\language_full.h"
};
char*p1[]=
{
#include "Language\french\language_full.h"
};
char*p9[]=
{
#include "Language\german\language_full.h"
};
}
Function code above is quite repeat: only language directory name, english, french, ..., german are changed - totally repeated for 10 times.
It is ok if so, but each language directory has 15 file, so I have to "repeat" the function for 15 times, so second to 15th function look like (only file name is different from first function):
every included h file is plain text as:
"good",
"bad",
"next",
void LangData::P_InitWeather()
{
char*p0[]=
{
#include "Language\english\Weather.h"
};
char*p1[]=
{
#include "Language\french\Weather.h"
};
char*p9[]=
{
#include "Language\german\Weather.h"
};
}
You can imagine how ugly the file is at last - I haven't completed it.
I think we may simplify code by #define or some idea, but the #include causes trouble to #define.
any ideas or suggestions?
thanks
modified on Monday, December 21, 2009 9:32 AM
|
|
|
|
|
Depending on what you are trying to do, you may be better off using Message Text Files[^], which allow you to have a set of common messages, but in different languages. This allows all your messages to be compiled into your application's resources and then referenced by unique id and language.
|
|
|
|
|
it is not suitable for me.
|
|
|
|
|
Sorry, but I am not sure that your request is possible, as the #include directive is a preprocessor directive and I do not think it can be generated from a #define statement.
|
|
|
|
|
the real problem is that #include statement must be in a line itself and excludes other code in the line.
this define and include is legal:
#define aaaaa "c:\....\my.h"
#include aaaaa
|
|
|
|
|
But this does not help you at all. I am not quite sure why you need to do this with #include statements, or what you are trying to achieve. As I said earlier I think the best method is to have a message file with the different languages as part of your resources.
|
|
|
|
|
Why do you need all the strings loaded at compile time?
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]
|
|
|
|
|
You cannot "#include" files at runtime.
Me think you need to review your language pack approach.
either generate resource only DLL, one for every language that will each share the same ID that will be referenced in the code; and have the DLL loaded when the application starts (or on demand)
or
have one language header file that contains all languages in a table, one line per word to be translated; and strings ID that will be references in the code; different than STRING resource id.
ID french english german ...
-------------------
123 "allo" "hello" "hallo"
...
...
YMMV.
Max
This signature was proudly tested on animals.
|
|
|
|
|
[quote]
either generate resource only DLL, one for every language that will each share the same ID that will be referenced in the code; and have the DLL loaded when the application starts (or on demand)
[/quote]
+1 to this argument. I think this is the best option.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Not sure about the overall design of your app, but I suppose you have english in place and you are going for I18N
Few options:
1) generate one resource dll per language, disadvantages, you will end up in 10 different files in your directory which you are already doing.
2) generate no dll (copy all the strings into the English id and then on you can make copies for each language. the advantage of the approach is you will have same ids, for all the languages. and you can make a wrapper function to load a string like
LoadMyString(langId,ID_OF_STRING_FROM_STRINGTABLE) and setting langID based on user selection or certain criteria for whole UI session.
disadv: you need all string information at compile time.
Regards
Abhi
|
|
|
|
|
First of all... I am not the one that started the thread, so your answer should be to the Top_Question_post, not to my oppinion. But.. anyways.
As answer to you...
1) Yes, you will have different files in your directory, but... take a look into your C:\Program Files\... and tell me how many of you installed software has less than 10 files in the folder.
If you don't like the DLLs, ok, I can understand it.
But you can use INI-Files as well, with the advantage that INI-Files can be easier to work with (just a Notepad may be enough if you don't want it more difficult to be modified), you can send them to a Translator or whatever and then just copy the "LangXXX.ini" in the application folder and it is done, just count on the possibility that the file may not be there when you call your "Change_Lang ()" and give an error message if that's the case.
2) Another disadvantage... for each and every single correction in the translations of you strings, you will need a new compile of the whole program, that means endless new versions of software just for "language issues" instead of software-bugs or additional features.
I guess the main point is just what one likes or not. And that's the nice thing on diversity, each person can choose whatever he/she likes better. I personally prefer independant files.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hi to All,
I have some problem in Logic, while reading a file (which has many objects of structure A,)...and buffering it to a dynamically allocated memory...
What I am doing exactly is that....I need to read the file...and if there is any data available, then put it to a new structure (dynamical allocated memory)...
Problem is ..<b>where do I declare/allocate memory for the structure</b>, I cannot declare in beginning of the loop, because fread() will overwrite into the same memory location...
something like....
A *lpA = new A;
while(fread(lpA,sizeof(lpA),1,ptr_myfile) != EOF)
{
...do something(Add the pointer into a List)
}
Similar problem with declaring it inside the loop... fread() needs the first parameter...
-----------------------------
I am a beginner
|
|
|
|
|
If you're using C++ , an option maybe usign STL constainers, for instance a vector :
std::vector <A> v;
A a;
while (fread(&a, sizeof(a), 1, ptr_myfile) != EOF)
{
v.push_back(a);
}
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]
|
|
|
|
|
Hi Friends
CImage img;
img.Load (" 1.jpg ");
img.save ("2.tif",Gdiplus::ImageFormatTIF);
its converting the image jpg to tif. but i need to convert with out comparession mode ..how to do it ??
thanks
Raju
Failure is Success If we learn from it!!
|
|
|
|
|
You've to use directly GDI+ Image (CImage is just a wrapper of) class for that purpose , I suppose.
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]
|
|
|
|
|
Use BMP, unless set for RLE, it uses no compression whatsoever.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi To All,
I have written a code to write some data to a binary file system ...(I am writing 3 structure with different size)...one after another. like A,B,C
I dont have any delimiter or special object to know the next size(bytes) to read from the file .
Because of that I always read one by one....
Now I want to overwrite the middle structure...(B).....While over writing I am having some problem...
what I did is...
...Read the file with size of A (in order to point the file pointer to the next memory..ie starting of struct B)...then write the second structure with the sizeof(B)...
I have open the file in r+b mode....
Now when I read the file its showing some error
please help me for the same...
-----------------------------
I am a beginner
|
|
|
|
|
What about:
- Read the whole file into the three variables.
- Modify the intended variable(s).
- Write again all the three variables to the file.
?
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]
|
|
|
|
|
I guess thats the easiest method, it dint strike my head...Hehe
Thanks anyway,
But for my knowledge I wanted to know, if we can do the other way....
-----------------------------
I am a beginner
|
|
|
|
|
Yes, of course, you may do it the other way: post your code if you need help about.
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]
|
|
|
|
|
Theoretically, it is the right thing you've done concerning the write part. However, when reading your file again you encounter an error.
We need source code here.
Easy Profiler : Now open source !
http://www.codeproject.com/KB/cpp/easyprofiler.aspx
|
|
|
|