|
Hi,
How to delete command bar controls of excel in c++?
I know when we automate excel, there is a functin GetCommandBars().
I dont know how to use this? Anyone has idea?
|
|
|
|
|
|
Hi all,
I have a doubt regarding window graphics painting.
As we already know we can draw a rectangle in window.
Ok...
Suppose I am drawing a rectangle with values ( 0, 0, 100, 100 ).
Now my question is,
can I draw a rectangle with values (0.5, 0.75, 100.1, 100.4) or something like that.
Why I am asking because, according to my understanding pixel is the smallest possible drawing resolution.
If it is possible, could you please help to implement that?
Regards,
Krishnakumar
|
|
|
|
|
GDI primitives accept only integers. You may use GDI+ (see for instance [^]).
Krishnakumartg wrote: Why I am asking because, according to my understanding pixel is the smallest possible drawing resolution.
The above is obviously true. GDI+ just gives a level of abstraction.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Tried the following code.
CDC* pDC = m_Window.GetDC();
Graphics graphic( pDC->GetSafeHdc());
CRect wRect;
m_Window.GetClientRect( &wRect );
wRect.DeflateRect( 0, 0, 1, 1 );
RectF rect( wRect.left, wRect.top, wRect.Width(), wRect.Height());
Color color;
color.SetFromCOLORREF( RGB( 100, 0, 0 ));
Pen pen( color );
graphic.DrawRectangle( &pen, rect );
rect.Inflate( -0.5, -0.5 );
Color color2;
color2.SetFromCOLORREF( RGB( 0, 100, 0 ));
Pen pen2( color2 );
graphic.DrawRectangle( &pen2, rect );
But the graphic.DrawRectangle( &pen2, rect ); draws the rectangle in the next pixel.
Is there anything additional to do to work the floating points?
regards,
Krishnakumar
|
|
|
|
|
Do you want to break the pixel?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Do you want to break the pixel?
You can do it, but the stuff that oozes out will make the image blurry...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: You can do it, but the stuff that oozes out will make the image blurry..
If so, what is the change I should make in my code?
Regards,
Krishnakumar
|
|
|
|
|
Krishnakumartg wrote: If so, what is the change I should make in my code?
You'll need to include schematics in your comments on how to build a tiny hammer. Then you'll be able to break just one pixel.
|
|
|
|
|
Nah: the pixel is the atomic graphic unit and, you known, the atom is indivisible...oops
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Don't believe the physicists... You crack open a pixel it oozes GUI goodness!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: You crack open a pixel it oozes GUI goodness!
Yeah - GUI Goodness and dangerous radiation. Want all your users growing a third arm, grabbing torches and pitchforks, then storming your office looking for blood? Then go right ahead, crack them pixels, address their internals like it's 1950 and Buck Rogers is gonna save the day in time for supper... 'Cause he ain't, and when your head is on a (pixelated) pike and the guys in bunny suits are cleaning up your mess, don't try using your undead lips to say i didn't warn you...
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
Mark Salsbery wrote: Don't believe the physicists...
I know: I'm physicist...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Actually I just wanted to know whether it is possible or not?
And if possible how can it do that?
Regards,
Krishnakumar
|
|
|
|
|
Krishnakumartg wrote: Actually I just wanted to know whether it is possible or not?
Yes, it is.
Krishnakumartg wrote: And if possible how can it do that?
For instance, with a hammer.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Krishnakumartg wrote: can I draw a rectangle with values (0.5, 0.75, 100.1, 100.4) or something like that
not without changing your mapping mode and viewport[^].
Krishnakumartg wrote: according to my understanding pixel is the smallest possible drawing resolution
that is correct; you can not turn on 1/2 of a pixel. the best you can do is let Windows change the coordinate system you use to refer to the physical pixels. so, you can draw that rectangle, and have 100.1 appear at a different location than 100.0. but all you've really done is changed the way Windows interprets your drawing coordinates.
|
|
|
|
|
Hi All
I have connected external (USB ) Hard Disk of 250 GB,which have been detected as local drive by system.How can i recognize it as external (Logical) drive?
|
|
|
|
|
Use GetLogicalDrives(), GetLogicalDriveStrings() and GetDriveType().
|
|
|
|
|
Hey everybody!
How can I get the thread count of a process - like in task manager?
I have a handle to that process, but I can't find a way to get the count of the running threads.
Does anyone know how to do that?
Thanks!!!!
|
|
|
|
|
First get the process id from your handle by calling GetProcessId() . Then Iterate the process in system[^] and locate your process by matching the process id. Then you'll get the total count of threads from PROCESSENTRY32.cntThreads .
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks!
|
|
|
|
|
need a code returning the current path of my exe
thx
|
|
|
|
|
|
You can use _pgmptr .
Regards,
Krishnakumar
|
|
|
|