|
QuickDeveloper wrote: the error is while typecasting sBuf to LPTSTR....
i didn't ask WHERE, but WHICH
man, if you don't tell us the error message, how do you want us to help you ?
we are not geniuses
|
|
|
|
|
v2.0 wrote: if you don't tell us the error message,
the error message is the title of the post
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Use this sBuf.GetBuffer(sBuf.GetLength())
Regards,
FarPointer
|
|
|
|
|
T2A converts to ANSI. In a Unicode build, LPTSTR will be a wide character, so setting a variable of type LPTSTR to the result of the T2A macro makes no sense. If you want pszRCPT to be ANSI (as implied by the code), declare it as LPSTR (note the missing 'T')
LPSTR - ANSI character string
LPWSTR - wide character string
LPTSTR - ANSI or wide character string depending on if _UNICODE is defined or not
|
|
|
|
|
Thank you very much..the problem is solved
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
T2A returns an ANSI string, but you're assigning to a LPTSTR (a Unicode string).
You also shouldn't be removing the const without a good reason, which I don't see in the snippet.
LPCSTR pszRCPT = T2CA(LPCTSTR(sBuf));
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Type checking ruins everyone's lives.
__asm
{
mov eax, [sBuf]
mov [pszRCPT], eax
}
|
|
|
|
|
Why can't I put a menu on an MDI child?!?! Who did this!?! Life is no longer worth living!
|
|
|
|
|
Hi,
How to change the security permission of a folder and a file.
Regards,
FarPointer
|
|
|
|
|
Search for Access Control Entry (ACE) and Access Control List (ACL).
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
which os r u using?
r u the Administrator of ur system?
if so. u can set the permission.
start>>control panel>>administrator tools>>local security policy>>windows setting>> local policy>>security option>>network acess sharing and security model for local sysem >>select classic - local....
now right+click the folder for which u need permission>> security tab>>
i belive rest of the thing u could do...
JAYARAJ
|
|
|
|
|
I am developing a dialog similar to Windows Word - Insert - Symbol Table Dialog.
For this all the charaters have to be displayed for the selected font (from all the existing fonts) and subsets which support the current font.
I am able to display the characters but some are appearing blank. These are the characters which are not supported by the the current font.
Can anyone tell me how to detect missing glyphs?
Thanks a ton,
Arti Gujare
Arti Gujare
|
|
|
|
|
i am working with dialog base application and there is several buttons on the dialog and setted bitmaps on these button but now i want to change image image on button when mouse over on this button and mousedown and mouseup and mouse down for some time all 4 events i want different image onthis button so for this
what i have to do for the same?
Bankey Khandelwal
Software Engineer
|
|
|
|
|
|
Has anyone ever had any success using "WaitCommEvent"
My experience thusfar is that it never returns. I have used some examples that i found using Overlapped I/O but they don't seem to work either. If anyone has had any success using this, please respond. I am not sure what else to try. All i want to do is catch a signal on the DSR pin when it is sent.
|
|
|
|
|
Greetings:
I have recently started using Visual Studio V7.0 (previously used V6.0), but still using MCF. I have continued to use CString for various things text storage but today I tried to use the "Find" member function.
What happened? VS 7.0 doesn't even seem to document CString and its members anymore. When I tried to build my program, I get this error:
error C2664: 'int ATL::CStringT<basetype,stringtraits>::Find(ATL::CSimpleStringT<basetype,t_bmfcdll>::XCHAR,int) throw() const' : cannot convert parameter 1 from 'const TCHAR *[7]' to 'ATL::CSimpleStringT<basetype,t_bmfcdll>::XCHAR'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>,
t_bMFCDLL=true
]
and
[
BaseType=char,
t_bMFCDLL=true
]
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Huh?
Can someone tell me how I can just use my faithful CString and get back to work?
Thanks in advance,
Mark
-- modified at 11:00 Wednesday 5th April, 2006
|
|
|
|
|
your program certainly have a MFC support lack...
|
|
|
|
|
Hi;
The program was initialized using the MFC App Wizard. It has a main window, menus, tool bars, status bars, etc, etc. All of them MFC classes. I have been using CString throughout until today when I tried to use "Find".
Mark
|
|
|
|
|
CString[^] is still documented.
but you might be missing to #include <afx.h>
|
|
|
|
|
Nope, its there. Its embedded in "stdafx.h". Furthermore, when I type CString in the index, there are several items listed but there is nothing that pertains to the documentation that you would expect to see for a supported class: namely "Members" and "Overview". They keep referring to some new class called CStringT.
|
|
|
|
|
CStringT is now a shared class between MFC and ATL. You need to include cstringt.h .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Didn't work. Same error.
Are you saying that I have to use CStringT now? This can't be! The dialog control, where I am having this problem, contains a simple edit box. When I use the "Add Member Variable Wizard" to associate a variable with my edit box, I select "Value" for the category. It automatically sets the type to CString. I have been using CStrings throughout my program successfully until this morning. The problem has appeared only because I want to search the string.
It is saying that I must use a PCXSTR pointer as the parameter. I have looked at the documentation for this but I cannot see how to convert a simple, NULL terminated string into one of these. Also, I cannot event get the compiler to recognize PCXSTR.
Any ideas?
Thank you,
Mark
|
|
|
|
|
CString IS CStringT !!!
it is like this for unicode uses...
|
|
|
|
|
Listen, I appreciate your help. I'm not trying to be contentious. You obvious know more about this that I do, however, I cannot see how you can say that "CStringT IS CString".
I'll just take my existing dialog header file and include a member variable:
CStringT m_strHello;
Here is the avalanche of errors that this generates:
c:\Development\uLTD\Software\uLTDTagConfigure\DecodedLogDlg.h(48) : error C2955: 'ATL::CStringT' : use of class template requires template argument list
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\cstringt.h(2245) : see declaration of 'ATL::CStringT'
DecodedLogDlg.cpp
c:\Development\uLTD\Software\uLTDTagConfigure\DecodedLogDlg.h(48) : error C2955: 'ATL::CStringT' : use of class template requires template argument list
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\cstringt.h(2245) : see declaration of 'ATL::CStringT'
c:\Development\uLTD\Software\uLTDTagConfigure\DecodedLogDlg.cpp(59) : error C2512: 'ATL::CStringT' : no appropriate default constructor available
c:\Development\uLTD\Software\uLTDTagConfigure\DecodedLogDlg.cpp(63) : error C2662: 'ATL::CStringT<basetype,stringtraits>::~CStringT' : cannot convert 'this' pointer from 'ATL::CStringT' to 'ATL::CStringT<basetype,stringtraits> &'
Reason: cannot convert from 'ATL::CStringT' to 'ATL::CStringT<basetype,stringtraits>'
Conversion requires a second user-defined-conversion operator or constructor
How can it be the same?
Mark
|
|
|
|