Solved

Code not working on window 8 of c++

Posted on 2013-10-27
2
289 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
A short article about a problem I had getting the GPS LocationListener working.
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…

759 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