Solved

Code not working on window 8 of c++

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

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 33

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
A short article about problems I had with the new location API and permissions in Marshmallow
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

19 Experts available now in Live!

Get 1:1 Help Now