|
Hello,
Yes I got the clue.
Thanks
|
|
|
|
|
Hi,
I'm trying to draw a small icon using a CPaintDC class. I've managed to get it to draw the large version of the icon, but not the small version. The code i've tried is as follows... but doesn't make the icon appear!
CPaintDC dc(this); // device context for painting
.
.
.
.
m_hIcon = ( HICON ) ::LoadImage( NULL,
MAKEINTRESOURCE( IDI_ERROR ),
IMAGE_ICON,
16,
16,
LR_DEFAULTCOLOR );
dc.DrawIcon(x, y, m_hIcon);
Thanks.
|
|
|
|
|
Whats return value of LoadImage?
|
|
|
|
|
It came out as zero... so it clearly couldn't find the icon. I've now managed to get the icon to display using a different method.
m_hIcon = ::LoadIcon(NULL, MAKEINTRESOURCE (IDI_ERROR));
::DrawIconEx(dc, X, Y, m_hIcon, 16, 16, NULL, NULL, DI_NORMAL);
This seems to work
If there's anything dodgy with using this please let me know!
|
|
|
|
|
what happens when use of this code
m_hIcon = ::LoadIcon(AfxGetApp()->m_hInstance, MAKEINTRESOURCE (IDI_ERROR));
::DrawIconEx(dc, X, Y, m_hIcon, 16, 16, NULL, NULL, DI_NORMAL);
|
|
|
|
|
That doesn't work.... as the m_hInstance doesn't contain the default icons. I got access to the icons through putting NULL. (It says to set it to zero on MSDN.)
Its all working fine for me!
|
|
|
|
|
|
Hai all
I'm using the active desktop Interface to get the current destop item count using the function GetDesktopItemCount(&count,0);
But on my desktop there is more than 10 things and the count value got by GetDesktopItemCount() is '1'.Why is it so.
Please reply.
My OS is XP.
Thanks in Advance
Robs
|
|
|
|
|
Does your problem solve with this[^] thread?
|
|
|
|
|
Any idea how to detect if another executable of same application is running and bring it to the foreground ?
Thanks in advance
Thanks,
Anand.
|
|
|
|
|
Anand Todkar wrote: another executable of same application
You can use a mutex object.
- NS -
|
|
|
|
|
|
Thanks mark, it works.
Thanks,
Anand.
|
|
|
|
|
How can I simply read/write specific values from an Excel spreadsheet (e.g. case at Row2; Column2) using C++?
That's all what I need to do and I'd rather not use the cumbersome classes that I've seen posted here.
Help please, I've been stuck on this for ages!!
|
|
|
|
|
Using Excel Automation is by far the easiest method.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry could you please elaborate. I've never heard of that..
|
|
|
|
|
See here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How do i check for Eof using a CFile object?????
|
|
|
|
|
gReaen wrote: How do i check for Eof using a CFile object?????
When the EOF is reached, the Read() function will return 0.
|
|
|
|
|
Naveen.R wrote: When the EOF is reached, the Read() function will return...
...a count less than what was asked for, not just 0 .
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I want to create a window through which a user can input say two numbers and this data is to be displayed after some manipulations on a seperate window in a grid. I am new to use VC++ don't know much about MFC. Can anyone give me an idea how should I start...Thank you
|
|
|
|
|
You can do it in a dialog based application. Use two edit controls to get the data.
But what do you meant by "separate window in a grid"?
- NS -
|
|
|
|
|
Sorry I wasn't clear about the grid part...What I meant was like suppose it's the location of two points then to represent it on a X-Y plane...
|
|
|
|
|
Means you need to show a point in graph like control? Then you may have to go for a custom control.
- NS -
|
|
|
|
|
And these editbox must set to number on the property window of editbox.do you want to send result to other window?
|
|
|
|