Click here to Skip to main content
15,900,418 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Launching Device Manager or manipulating device manager from C++ Pin
Mike Dimmick14-Aug-06 14:22
Mike Dimmick14-Aug-06 14:22 
QuestionCommand Line of a call to CreateProcess catchable? Pin
Stone Free14-Aug-06 5:05
Stone Free14-Aug-06 5:05 
AnswerRe: Command Line of a call to CreateProcess catchable? Pin
David Crow14-Aug-06 5:32
David Crow14-Aug-06 5:32 
AnswerRe: Command Line of a call to CreateProcess catchable? Pin
bolivar12314-Aug-06 6:17
bolivar12314-Aug-06 6:17 
AnswerRe: Command Line of a call to CreateProcess catchable? Pin
Mike Dimmick14-Aug-06 14:28
Mike Dimmick14-Aug-06 14:28 
QuestionQuestion about "optimal" set up of VC++ 6 environment Pin
ldsdbomber14-Aug-06 4:25
ldsdbomber14-Aug-06 4:25 
AnswerRe: Question about "optimal" set up of VC++ 6 environment Pin
David Crow14-Aug-06 4:59
David Crow14-Aug-06 4:59 
QuestionProblem with using Image object in GDI+ (VC++) Pin
Dhananjayak0214-Aug-06 4:19
Dhananjayak0214-Aug-06 4:19 
Hi,

i needed to change the position and rotate a GIF image in given angles as per user inputs in a MFC application .

So I started to use Image object in GDI+.My intention was to make a Image object and manupulate its position and orientation.(As given in msdn page titled Drawing, Positioning, and Cloning Images - refer the link below)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/AboutGDIPlus/IntroductiontoGDIPlus/OverviewofGDIPlus.asp[^]

I tried to insert a image to my main frame using "Image" in GDI+. But a runtime error (unhandled exception) is occuring when im going to run the program.The details are as follows.

I have included "gdiplus.h" in StdAfx.h. There were no issues on that.But the problem started when i tried to insert a image using the guidelines given in above msdn link(.Drawing, Positioning, and Cloning Images - GDI+)


As per that method I used the following code:

CPaintDC dc(this);<br />
Graphics myGraphics(dc.m_hDC);<br />
<br />
Image myImage(L"robot.gif"); // this line creates the problem<br />
myGraphics.DrawImage(&myImage, 20, 10);


The program Built & compiled successfully in VC++ 6.0.But didn't run.It gaves a error.

When I insert that code to a .NET project the error message says that ;"Unhandled exception at 0x7c9105f8 in tttdk.exe: 0xC0000005: Access violation reading location 0x00000010."
When I break it , it shows the location of the error in the following cpp file.

D:\VS\VC\atlmfc\src\atl\atls\allocate.cpp

<small>..<br />
<br />
...<br />
<br />
CAtlTraceCategory *CAtlAllocator::GetCategory(int iCategory) const<br />
<br />
{<br />
<br />
if(iCategory == m_pProcess->CategoryCount())<br />
<br />
return NULL;<br />
<br />
<br />
<br />
ATLASSERT((iCategory < m_pProcess->CategoryCount()) || (iCategory == -1));<br />
<br />
CAtlTraceCategory *pCategory = NULL;<br />
<br />
if(iCategory >= 0)<br />
<br />
{<br />
<br />
BYTE *pb = reinterpret_cast(m_pProcess) + m_pProcess->MaxSize(); // this is the location of the error<br />
<br />
pCategory = reinterpret_cast(pb) - iCategory - 1;<br />
<br />
}<br />
<br />
return pCategory;<br />
<br />
}<br />
<br />
..............</small>

Please help me regarding the above matter ASAP.or else tell me way to Insert a GIF image to a MFC frame and to change its position and rotate by given angles time to time.


Thisara



ENTC
UoM

AnswerRe: Problem with using Image object in GDI+ (VC++) Pin
Mike_V14-Aug-06 4:28
Mike_V14-Aug-06 4:28 
GeneralRe: Problem with using Image object in GDI+ (VC++) Pin
Dhananjayak0214-Aug-06 4:44
Dhananjayak0214-Aug-06 4:44 
GeneralRe: Problem with using Image object in GDI+ (VC++) Pin
Mike_V14-Aug-06 4:57
Mike_V14-Aug-06 4:57 
AnswerRe: Problem with using Image object in GDI+ (VC++) Pin
Hamid_RT15-Aug-06 8:13
Hamid_RT15-Aug-06 8:13 
QuestionTo change the tray icon dynamically Pin
johnalek14-Aug-06 2:27
johnalek14-Aug-06 2:27 
AnswerRe: To change the tray icon dynamically Pin
Dave Calkins14-Aug-06 2:51
Dave Calkins14-Aug-06 2:51 
QuestionAnit Copy Pin
Waldermort14-Aug-06 2:24
Waldermort14-Aug-06 2:24 
AnswerRe: Anit Copy Pin
David Crow14-Aug-06 3:37
David Crow14-Aug-06 3:37 
AnswerRe: Anit Copy Pin
Joe Q14-Aug-06 4:56
Joe Q14-Aug-06 4:56 
AnswerRe: Anit Copy Pin
Max Santos14-Aug-06 10:51
Max Santos14-Aug-06 10:51 
GeneralRe: Anit Copy Pin
Waldermort14-Aug-06 15:17
Waldermort14-Aug-06 15:17 
QuestionProblem in MSMQEvent. Pin
uday kiran janaswamy14-Aug-06 1:00
uday kiran janaswamy14-Aug-06 1:00 
Questionhow to set the menu bar??? Pin
mimimimilaw13-Aug-06 23:33
mimimimilaw13-Aug-06 23:33 
AnswerRe: how to set the menu bar??? Pin
prasad_som13-Aug-06 23:41
prasad_som13-Aug-06 23:41 
GeneralRe: how to set the menu bar??? Pin
mimimimilaw13-Aug-06 23:50
mimimimilaw13-Aug-06 23:50 
GeneralRe: how to set the menu bar??? Pin
prasad_som13-Aug-06 23:58
prasad_som13-Aug-06 23:58 
GeneralRe: how to set the menu bar??? Pin
mimimimilaw14-Aug-06 0:41
mimimimilaw14-Aug-06 0:41 

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.