|
I think ther first three ones can be resolved by type-converting.
(4) should use _T("") macro or L prefix.
|
|
|
|
|
You can either change array declarations (i.e. TCHAR instead of char ) and then assign them consistently or apply string conversions http://msdn2.microsoft.com/en-us/library/87zae4a3(VS.71).aspx[^].
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.
|
|
|
|
|
Without seeing the code that is causing these errors, it's difficult to say exactly the best way to solve them.
For the CStdioFile.Open, if you are using something like
myFile.Open("test.txt", CFile::modeCreate); you could just change it to
myFile.Open(_T("test.txt"), CFile::modeCreate);
The same may be try for the ATL::CStringT problem. The following code could cause the error:
CString myString("Test"); Again, this can be fixed by using
CString myString(_T("Test"));
The advantage is that this will work with either MBCS or Unitcode builds.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
My OS is Windows XP professional. I set my location to US and Language to English.
So,when I want to print some no English words like Chinese,Japanese,I would failed. For example
wchar_t *s = L"??";//?? are some non-English words,it did not display rightly
int err = wprintf(s);//operation failed,err = -1,
wcout<<s<<endl;//no output on the screen
I want to know why the printing operation would be failed.
Someone would advise me to set my system's default location and language,but,if a system with US location and open a file with such non-English file,how should it to display the content?
Thanks.
modified on Friday, December 07, 2007 2:27:13 AM
|
|
|
|
|
The problem is that a computer with the language you are talking about, created the file with it's own charsets and fonts. Codes for these characters has a glyph in that font but they don't in your current font or they even don't exist in your current character set. Some info about these terms[^]
So here you have two options:
1. The hard and right way: define your application to use Unicode. You shall take care of all strings and all functions that use strings since each character will take (at least) two bytes instead of usual one byte. You also should take care of all functions that ask you to enter Size or Length of the string which will be different. I'm still not 100% sure this helps when printing, but as softwares like MS Office Word can do the job, they'll do it this way probably.
2. The easy way(might not help for printing): Install the language in your computer and ask windows to select it as your default language for NON-UNICODE applications: Go to control panel->Regional and language options, select Advanced tab and check if you can find the language you want in the combo box under 'Language for non Unicode programs' if not go to Language tab where you should select if it's an East Asian or if it has complex scripts, then apply and return back to Advanced. Find the language and select it. Apply changes and your application should not show those characters any longer, but I doubt it fixes print problem. Also note that in VC6 You have to right click on dialogs in your resource view and choose [Neutral] instead of default English language if you want to show characters truely on screen.
// "In the end it's a little boy expressing himself." Yanni
while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Yes,I agree with you.
In fact,my problem is that,when I reading the ID3v1 text tags from a .mp3 file.There is no enough information about characterset of the text string coding.So,if a text string is non-English encoded,the reading and displaying would failed.A text string in ID3v1 is a 30 characters(also is 30 bytes) long array.I read it one by one,and call MultiByteToWideChar function to convert the string into Unicode string,but the converted Unicode string is incorrect.
Thanks
|
|
|
|
|
Please do some tests to find out how you need to act:
Use debug window to see the memory address of the variable that you use to store the id3 tag. Also try changing debug option that says 'Use Unicode string'. It's likely that debug window shows true characters and that shows you to use Unicode.
Make sure your dialogs where you display the text on them have neutral language set. Try displaying data in GDI controls like Static or TextBox instead of directly drawing them on the DC.
Try softwares that display these data, like WinAmp or JetAudio, if you have access to them and check to see if they can display the tag truely.
If you noticed any difference, you can find a true solution to the problem, or at least you'll have a clue to start from.
// "In the end it's a little boy expressing himself." Yanni
while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Hello,everyone
I'm using vc6.0, using ms datagrid control 6.0
I want to change the color of the current row in datagrid.
Changing the current row's font or other things to make the row selected noticeable is also OK!!
Thanks!!
modified on Monday, December 10, 2007 7:39:03 PM
|
|
|
|
|
hi all
Currently i am creating a window mobile program using visual c++. wanted to find out what is the code to redirect my current dialog to another new dialog in 2 seconds.
Thanks for your help. Appreciate your help guys.
|
|
|
|
|
what about putting timer in your application, which open new dialog after 2 seconds!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hi all,
I'm working with a map to store a string, int pair. I want to make my code more clear. So I'm try to define my map in a common place and use to store data on it. So where should I declare the map.
I've try to define in the class definition file(class header file), but in the data insertion statement I got the following error.
<br />
error C2678: binary '[' : no operator found which takes a left-hand operand of type 'const std::map<_Kty,_Ty>' (or there is no acceptable conversion)<br />
I've declared the map as follows,
map<string, int=""> data_map;</string,>
How can I solved this.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Firstly map not declared as
map data_map;
if you have to store an int & a string inside the map then declaration will be like this: -
map< int,std::string > data_map;
In this the integer filed will be your primary field and corresspoding to which you get the data.
Regards,
Pankaj Sachdeva
There is no future lies in any job but future lies in the person who holds the job
|
|
|
|
|
Oops,
Really sorry about that. Miss the middle part of the code, may be because of the code tags.
Its like this,
map<string, int=""> data_map
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: Really sorry about that. Miss the middle part of the code, may be because of the code tags.
Oops you did it again!
Use the pre-Tag to enclose the code or use the < > tags instead of the one on your keyboard.
You'll find them below the text editor when writing the message!
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Karismatic wrote: Firstly map not declared as
map data_map;
His map is declared as:
map<string, int=""> data_map;
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi Experts,
I want to create a project that has two view :
First view displays the tree view of all files and folders and
Second view displays the corresponding file click on the folder of first view.
My mean to say like a Windows Explorer view.
How can I achieve it.
Thanx in advance.
|
|
|
|
|
First, the division is to be made through SplitterView, the left side as CTreeView and the right side as CListCtrl or CListView in report mode
Greetings.
--------
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Does anyone know where the demo and zip files from this google cache are ? The links off of the cache are broken.
http://64.233.169.104/search?q=cache:_hGEheYkd6YJ:www.codeproject.com/debug/LibView.asp+view+.lib+function&hl=en&ct=clnk&cd=1&gl=us&client=firefox-a[^]
On the google cache html there is some code, but I'd prefer to download the original demo, since I'm not entirely sure how much code is missing from the excerpt.
The motive:
My task is to make arbitrary c++ source code trees available to .NET. I created a program to scan the header files and create a SWIG interface file to input into SWIG which generates pinvoke signatures (in a large C++ file (150000 lines)) for the libraries. The problem is, sometimes the header files contain signatures that didn't get implemented in the libraries and therefore I get a bunch of linker errors.
So in order to workaround this, I would like to scan the .lib files for function definitions and then compare against header files in order to determine what's been implemented (without having to do it manually - these source code trees are huge).
Thanks for your help.
|
|
|
|
|
|
Im posting this here in the hopes of a quicker answer (as opposed to the Graphics forum).
I've been playing around with DirectX in C# for quite some time now with success. All the tutorials in the DXSDK9.0 run fine for C# and VB.Net.
I want to learn how to use DirectX in C++, but when I try and run any C++ example I get the below errors...
1. Error LNK2019: unresolved external symbol _Direct3DCreate@4 referenced in function “long_cdecl InitD3D(struct HWND__*)”(?InitD3D@@YAJPAUHHWD__@@@Z)
2. Fatal error LNK1120: 1 unresolved externals
These errors were generated when I tryed to run the very first tutorial (initialise a DirectX device).
I figure there maybe a header file I need to move somewhere.
Has anyone run into this problem before, and/or knows how I could fix it?
Kind Regards,
Mark.
|
|
|
|
|
MarkBrock wrote: I figure there maybe a header file I need to move somewhere.
Those are linker errors, not compiler errors, so they don't involve missing headers.
You need to link to the appropriate DirectX import libraries.
You can add them to your project, add them to the project's Linker/Input settings,
or add something like the following lines to a source file:
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#pragma comment(lib, "dxerr9.lib")
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ok, Thanks Mark, i'll try that when I get home from work.
It's just interesting that these error's were appearing in the tutorials included within the DirectX SDK itself. I know for certain that the link to the 'd3d9.lib' was in the code, but i'll try the other two and see what happens.
Thanks.
Mark.
|
|
|
|
|
Hi, I'm getting the following problem.
error C2065: 'string' : undeclared identifier
but I have included "#include <string>" at the beginning of the cpp file. when I compile the code, compiler tells me this error on the following code:
string strPath;
any idea? thanks a lot!
|
|
|
|
|
and I have added "using namespace std;" after "#include <string>". still not working and it tells me that 'std' : does not exist or is not a namespace.
|
|
|
|
|
found why. I put the "#include <string>" before #include "stdafx.h". after I updated it. it's working.
|
|
|
|