Solved

Code not working on window 8 of c++

Posted on 2013-10-27
2
279 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
  • 2
2 Comments
 
LVL 32

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 32

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A short article about a problem I had getting the GPS LocationListener working.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now