Solved

Code not working on window 8 of c++

Posted on 2013-10-27
2
291 Views
Last Modified: 2013-11-20
hi
code working fine on window XP but on window 8 not working and project setting character  set==Use Multi-Byte Character Set other then UNICODE
and no compile error  on window 8 please suggest the solution
 
Cstring FolerPath;
Bitmap bmp;

int nLen = FolerPath.GetLength() + 1;
WCHAR* pwsz = new WCHAR [nLen];  
mbstowcs (pwsz,FolerPath,nLen);
CLSID encoderClsid;
GetEncoderClsid(L"image/bmp",&encoderClsid);            
bmp.Save(pwsz,&encoderClsid,NULL);                        
delete pwsz;

error on saving bitmap =win32Error on window 8  at Execution of program and many time exe not execute on window 8  .
0
Comment
Question by:davinder101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 34

Expert Comment

by:sarabande
ID: 39606633
you probably need to check the return values of the calls above the Bitmap::Save.

I would assume that GetEncoderClsid returns -1 what is an error.

Sara
0
 
LVL 34

Accepted Solution

by:
sarabande earned 500 total points
ID: 39606647
if i am right you need to install the missing encoder (32-bit) at your windows 8.

Sara
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question