|
Make sure you install the service packs (I do believe SP1 is out for VS2010), I use VS2008 and have not major complaints after the first service pack.
Kyudos wrote: How can I get rid of the MSB8012 warning?
Use a #pragma warning( disable: WARNING_NUMBER ) statement
Kyudos wrote: Output a DLL to a non-standard location and it starts freaking out.
I do this all the time in VS2008 and it has no problem with it, wouldn't imagine they changed that very much from one release to another.
Kyudos wrote: error LNK1318: Unexpected PDB error; ACCESS_DENIED (15)
These are the type of random errors you sometimes experience pre-service packs...
I hope your experience with VS2010 gets better, I've seen a lot of improvements from the usability stand point and the better standard C++ compliance is certainly a great step forward for MS. Good luck! 
|
|
|
|
|
Thanks Albert - I downloaded SP1 and now have a different set of problems!
At first my application would crash the development environment every time I tried to debug (F5),
so I decided to do a full rebuild.
Now one of my Fortran libraries won't compile, because it appears to be looking for a dependent library in a weird place:
fatal error LNK1181: cannot open input file 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\...'
I can't seem to find anything that would make it look there for lib files.
Any ideas?
EDIT: Ah - Fortran problem!
Solution[^]
modified on Sunday, July 17, 2011 11:56 PM
|
|
|
|
|
So you got your linker problems resolved?
|
|
|
|
|
Yeah, finally, thanks. Will just have to wait and see if SP1 improves the general stability - I've had the dev-env crash a couple of times already though.
|
|
|
|
|
They usually do, what OS are you running on?
|
|
|
|
|
XP SP3 at the moment, but we'll be looking to move to Win7 in the near future.
|
|
|
|
|
Wow, I've never really had many problems with stability in XP. I did have quite a few in Win7 and Vista up until the initial SPs in VS2008.
|
|
|
|
|
Hello All,
here I have another 2 doubt of ATL::CString
1. I am not able to overridden ATL::CString class, in a proper way. Is it necessary to override all the methods of this class? I want to override only a few actually.
2. for all the character operation, it warns me " conversion from 'wchar_t' to 'char', possible loss of data"
char tt = strTemp[0];
Is there any way to convert 'wchar_t' to 'char' as in global way, so that i don't need to typecast it everytime like
char tt = (char)strTemp[0];
thanks in advance
hrishi
|
|
|
|
|
I guess your project setting in UNICODE. If so, CString will be using wide char (wchar_t) to manipulate strings. The problem is, you are treating them as multibyte characters (char). I suggest you to use TCHAR type instead of hard coding char & wchar_t, as it can be used well in both unicode and multibyte configurations.
|
|
|
|
|
Thanks for your reply
what about setting the project as character set : Not set,
in this case, as your suggestion, do I need to replaced all char to TCHAR in the whole project. Thats a lot . . I was trying to avoid much touch in the project implementation
How about having my own class CMyString : public ATL::CString, can i do something in this way to avoid less touch to the project code ? Please note that the current project uses char not wchar_t. Project setting could be change according to our convenience
thanks in advance
hrishi
|
|
|
|
|
1. If character set is 'Not Set', i think char will work.
2. CMyString can be alright. Write it to take char only, and internally convert them to wchar_t if the Character Set is 'Unicode' (using APIs like MultiByteToWideChar) and let the CString base class to do the string operations. This will help you to retain all the char types in existing code, provided you are replacing all usage of CString with CMyString. And the implied issue is that you won't be able to manipulate non-english characters with CMyString.
|
|
|
|
|
Thanks for your reply, It was of great help.
I followed the same way as you suggested. But found a very interesting problem. Following is the explanation:
I should be able to use + operator like below..
CMyString strTemp;
strTemp = "aa" + strTemp;
And for this I need to overload the +operator.(Reason:: I get a error which says::
error C2678: binary '+' : no operator found which takes a left-hand operand of type 'const wchar_t [3]'
I am not able to find a appropriate way to call the operator+ of the base class, or any other way to solve the same. [ All I need is, inside operator+ overloading , to convert the char to wchar and then pass it to the base class]
Please help me.
thanks in advance
Hrishi
|
|
|
|
|
I don't understand why you do not use the CStringT [^] class, which already includes the code for overloading the + operator. What extra functionality does your derived class offer that CStringT does not already include?
The best things in life are not things.
|
|
|
|
|
I think you need to bite the bullet and convert all your char variables and constants to TCHAR. If you do not, you will continue to have problems like this. If it were easy to solve the multi-byte to Unicode to multi-byte character conversion issues that solution would be part of the CString class.
The changes you need to make are mechanical. You need to put _T() around all your string and character literals. You need to change all your char variables to TCHAR.
I don't know how big your project is, or if you have access to all the source. I suspect you have spent more time trying to avoid the issue than a proper fix would require.
|
|
|
|
|
You cannot use casting to convert from a large element type to a smaller one without potential loss of data, you must use some form of conversion. If you stick with the default CString [^] class it will handle either char or wchar_t depending on your project settings. If your project needs to use both Unicode and MBCS then you need to provide conversion functions at the appropriate parts of your application. If it will only ever use one or the other but you need to provide a version that will handle each type then use TCHAR as the type for all your character variables and _T("constant string") macros for all constants. That way you can simply rebuild your project to handle the appropriate encoding.
The best things in life are not things.
|
|
|
|
|
thanks for your reply.
TCHAR was a great help.
I am facing another problem, while implementing the same. could you please take a look and follow the above comments of mine.
thanks in advance
Hrishi
|
|
|
|
|
Hello all,
I need to avoid MFC from my existing project, and convert to ATL. I am using STL for the most of the conversion (defining my own class for MFC type)
CString has been use extensively in the project. So I guess its better to implement my own CString class. So that I dont need to touch all the implementation.
I found out that ATL also has CString
typedef CAtlString CString;
So, if project setting avoids MFC, then CString will be refererd from this ATL CString class. But the problem is I need to touch and convert many code like
"xx" to L"xx"
char to wchar_t
Can I have a efficient way, in order to avoid touching much implementation, and character code supportness.
Shall I override this ATL CString class? or better right my own?
considering about the supporting of character type (Unicode/others), could you Please suggest me, or advice me.
thanks in advance
Hrishi
|
|
|
|
|
The reason you're having those issues is that your original project probably had a setting of "Use Multi-Byte" characters or "ASCII" or something similar and now you seem to be attempting to use unicode. If you change you new project settings to use multi-byte characters or ASCII you won't have that problem but if you must use unicode, then you'll have to face the issue regardless. There may be some macros out there to help you out though, try searching google for them. Macros can be error prone however, so if its your intention to continue with unicode then you'll have to address the character and string definitions.
|
|
|
|
|
I use CString all the time but not the ATL::Cstring
It seems to be handy with MessageBox and other system calls so I use it all the time
What is the issue with CString that is bothering you?
http://www.contract-developer.tk
|
|
|
|
|
Why did you post that as a reply to me?
|
|
|
|
|
use find and replace tool to replace ' "' to ' L"'.
|
|
|
|
|
I have some MFC code that positions a combobox on a dialog using SetWindowPos. This works fine at 96 DPI but the dropdown fails at 150 DPI (it doesn't show).
SetWindowPos is apparently setting the size and position of the combo and the dropdown at 150 DPI - that's fair enough, we can work around it. But why does it work at all at 96 DPI?
|
|
|
|
|
I've never noticed this before, but if so... that should cause all sorts of anomalies in peoples code I would imagine... Good question.
|
|
|
|
|
Hello everyone
Could anyone please tell me, is there any way to separate the definition of the methods of a template class ,from header file to .cpp file.
I know the way, wherein, we define all the methods in a file( with extension other then .cpp), and include the file at the end of the header file of the template class.
But this method looks no good, is there any clean and usual way just like other class.
thanks in advance
Hrishi
|
|
|
|
|
The reason for placing definitions in a header file is so that they can be included in many implementation (.cpp ) files. If your definitions are only used within one implementation file then you can put them at the top of that file.
Or did I misunderstand your question?
The best things in life are not things.
|
|
|
|