Click here to Skip to main content
15,892,674 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite6-Nov-08 14:42
e_ilite6-Nov-08 14:42 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
Mark Salsbery6-Nov-08 15:00
Mark Salsbery6-Nov-08 15:00 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite6-Nov-08 15:04
e_ilite6-Nov-08 15:04 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
Mark Salsbery6-Nov-08 15:24
Mark Salsbery6-Nov-08 15:24 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite6-Nov-08 15:38
e_ilite6-Nov-08 15:38 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
Mark Salsbery6-Nov-08 16:17
Mark Salsbery6-Nov-08 16:17 
GeneralRe: I loaded a bitmap from resource and share it with some windows to paint for background,but sometimes the bitmap will be changed to black? Pin
e_ilite6-Nov-08 18:38
e_ilite6-Nov-08 18:38 
Questionerror C2022: '65279' : too big for character Pin
monsieur_jj3-Nov-08 14:51
monsieur_jj3-Nov-08 14:51 
Hi all,

I am getting an error C2022: '65279' : too big for character at the line in bold below, What should I change here? This code works if I use wsprintfW and wszBuffer is WCHAR however I need this for multibyte and must use "_T" not "L"
Any advise?

Thanks,
Jayjay
if( pRegInfo->uTaskRegID == 0 )
         {
            GUID AppGUID, TaskGUID;
            ::CoCreateGuid(&AppGUID);
            ::CoCreateGuid(&TaskGUID);
            WCHAR wszGUID[50], wszTaskGUID[50];
            ::StringFromGUID2(AppGUID, wszGUID, 50);
            ::StringFromGUID2(TaskGUID, wszTaskGUID, 50);
            TCHAR wszBuffer[1025] = { 0 };
            ::wsprintf(wszBuffer, 
               _T("\xfeff<?xml version=\"1.0\" encoding=\"UTF-16\" ?>\n")
               _T("<applications xmlns=\"http://schemas.microsoft.com/windows/cpltasks/v1\" xmlns:sh=\"http://schemas.microsoft.com/windows/tasks/v1\">")
               _T("<application id=\"%s\">")
               _T("<sh:task id=\"%s\" needsElevation=\"%s\">")
#ifdef _UNICODE
               L"<sh:name>@%s,-%ld</sh:name>"
               L"<sh:keywords>@%s,-%ld</sh:keywords>"
               L"<sh:command>%%systemroot%%\\system32\\control.exe /name %s</sh:command>"
#else
               _T("<sh:name>@%hs,-%ld</sh:name>")
               _T("<sh:keywords>@%hs,-%ld</sh:keywords>")
               _T("<sh:command>%%systemroot%%\\system32\\control.exe /name %hs</sh:command>")
#endif // _UNICODE
               _T("</sh:task>")
               _T("<category id=\"%ld\">")
               _T("<sh:task idref=\"%s\"/>")
               _T("</category>")
               _T("</application>")
               _T("</applications>"),
               wszGUID,
               wszTaskGUID,
               pRegInfo->dwRunLevel == 0 ? _T("false") : _T("true"),
               szDllName, Info.uTaskRes,
               szDllName, Info.uKeywordsRes,
               Info.pstrCanonicalName,
               pRegInfo->dwCategory,
               wszTaskGUID);
            ::wsprintf(szGUID, _T("%ws"), wszGUID);
            ::lstrcpy(szTaskFileUrl, szDllFile);
            ::wsprintf(_FindLastOf(szTaskFileUrl, '.'), _T("_cpl%d.xml"), pRegInfo->iIndex + 1);
            if( bRegister ) {
               HANDLE hFile = ::CreateFile(szTaskFileUrl, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
               if( hFile == INVALID_HANDLE_VALUE ) return HRESULT_FROM_WIN32(::GetLastError());
               DWORD dwWritten = 0;
               ::WriteFile(hFile, wszBuffer, ::lstrlen(wszBuffer) * sizeof(WCHAR), &dwWritten, NULL);
               ::CloseHandle(hFile);
            }
            else {
               ::DeleteFile(szTaskFileUrl);

AnswerRe: error C2022: '65279' : too big for character Pin
Saurabh.Garg3-Nov-08 15:11
Saurabh.Garg3-Nov-08 15:11 
GeneralRe: error C2022: '65279' : too big for character Pin
monsieur_jj3-Nov-08 15:17
monsieur_jj3-Nov-08 15:17 
GeneralRe: error C2022: '65279' : too big for character Pin
Saurabh.Garg3-Nov-08 15:29
Saurabh.Garg3-Nov-08 15:29 
GeneralRe: error C2022: '65279' : too big for character Pin
Bram van Kampen4-Nov-08 11:51
Bram van Kampen4-Nov-08 11:51 
Questionstange behavior with OpenGL in VC++.Net Pin
smorel23-Nov-08 12:34
smorel23-Nov-08 12:34 
Questionndis set from visual c++ Pin
ggfernandez3-Nov-08 8:48
ggfernandez3-Nov-08 8:48 
Questionimage acquition Pin
jjvr3-Nov-08 8:22
jjvr3-Nov-08 8:22 
AnswerRe: image acquition Pin
led mike3-Nov-08 10:35
led mike3-Nov-08 10:35 
GeneralRe: image acquition Pin
Bram van Kampen3-Nov-08 15:30
Bram van Kampen3-Nov-08 15:30 
QuestionConverting from CString to char (or simple text) Pin
shpid3r3-Nov-08 7:35
shpid3r3-Nov-08 7:35 
AnswerRe: Converting from CString to char (or simple text) Pin
CPallini3-Nov-08 7:57
mveCPallini3-Nov-08 7:57 
Questionsorting Pin
Member 41579873-Nov-08 6:30
Member 41579873-Nov-08 6:30 
QuestionRe: sorting Pin
David Crow3-Nov-08 6:41
David Crow3-Nov-08 6:41 
AnswerRe: sorting Pin
Bram van Kampen3-Nov-08 15:35
Bram van Kampen3-Nov-08 15:35 
AnswerRe: sorting Pin
Ahmed Charfeddine3-Nov-08 21:55
Ahmed Charfeddine3-Nov-08 21:55 
Questionglobal new operator issue Pin
Abyss3-Nov-08 5:52
Abyss3-Nov-08 5:52 
AnswerRe: global new operator issue Pin
CPallini3-Nov-08 6:46
mveCPallini3-Nov-08 6:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.