CDC::Rectangle and client area
Lets say that place a rectangle border on the client area at
10,10,45,45. And lets say that client area is 200x200 or so. How can
I make the recangle border resize itself in proportion to the changes
of the client area? In other words, lets say I resize the client to
250x200 etc. How can I adjust the border of the rectangle to widen
itself? What would the formula look like to figure out the percentage
This is pretty simple arithmetic.
You have a rectangle which is 10,10, 45, 45. Therefore it is a 35x35 rectangle. It
represents 35/200 of the area, and it starts 10/...Japanese Version of MSCRM
I have a few questions regarding MSCRM3.0 for a client in Japan:
1. I have heard that the the Japanese version of MSCRM3.0 will be
released in Japan in September 2007. It has already been released in
the US. Is there a way a partner can buy it from the US for a client in
2. My second question is: On the same screen, the user needs to input
data in English script on one field and Japanese script on another
3. My client's database is Oracle. Since Microsoft does not support
Oracle, I can convince them to migrate to MS SQL Server. How should I
go about this one time...Getting CDC
I want to display something in the OnUpdate method, how do I get a handle to
the CDC from here?
> I want to display something in the OnUpdate method, how do I get a handle to
> the CDC from here?
This sounds like a beginner's mistake. You can call GetDC, but that is
poor design and probably won't work the way you intend.
Painting in OnUpdate will be lost after the window is minimized/restored
or covered/uncovered. The default OnUpdate solves this problem by
calling Invalidate(). Then the painting is done in the resulting
OnDraw,...CDC::arc() with big pen crash on win98
I've encountered a problem that occurs only under Win98:
I have a dc object and I'm trying to draw an arc (I'm using the CDC::arc()
I'm using a pen that has a big width.
The problem is that it crashes sometimes (only when the arc is big and only
a small part of it is displayed).
I tried to look in the knowledge base for this kind of bug and I found
something but it was a Win95 bug.
How can I know when the CDC::arc() function will crash? For example, I had a
problem when the bounding rectangle was bigger than 32767 (it crashed also
under Win98) but since I knew wh...Help! Japanese characters display as Question Marks in OWA
I have a VIP who needs to be able to read his e-mail via OWA. He is unable to
read e-mail with Japanese character content via OWA. The subject lines are
perfect Japanese characters, but the body of the message is all question
marks and weird symbols. When he connects to another office's OWA mail
server, using the same pc, he can see the Japanese characters in both the
subject line and the body of the message just fine. Internally, when he uses
the Outlook 2002 client, he sees the Japanese characters in the body and
subject line with no problem as well. The problem only occurs when v...which CDC
I am a bit confused as to which dc to call in the following situation. I
have a dialog app with a static control on it that I am using to paint a
graph on. I am doing the drawing in the lbuttondown function in the dialog
class. My qestion is how do I call the device context to paint on the
static control. Do I use the CClientDC dc(this); to get the device
context of the dialog and do the drawing using this dc, or do I call
CClinetDC dc(&m_myStaticControl); or dc = m_myStaticControl.GetDC(); to
get the dc of the control, and use it to do the drawing? Are all these ...DrawText with DT_WORDBREAK: DT_CALCRECT computes too small a height
I'm trying to print a number of possibly long strings using an
MFC application. The strings are to be broken into lines using
DrawText's DT_WORDBREAK mode. In order to determine the number
of print pages required for all the strings, I use DT_CALCRECT
to determine the total height of all strings without actually
doing any output. I'm using a function like this:
// Prints a string beginning at the indicated y position
// on the page. xSize is the width of the page.
// Print indicates if we actually want to do any output
// (Print=true) or simply compute the output height
//...Problem with DrawText in XP
Problem with DrawText in XP
Question: I have developed a MFC program, which is calling many times the
DrawText function. With Windows 98, ME and NT there is no problem but with
XP the characters painted by the last call to DrawText in OnPaint appear
very slowly on the screen. I 'm using Visual C++ 6.0 with service pack 5. I
use MFC in a static library. How can I solve this problem?
size = pDC->GetTextExtent(pNode->m_str);
DT_SINGLELINE | DT_LEFT | DT_VCENTER);
rect.left += size.cx;
rect.le...HDC and CDC
I am attempting for the first time to use CreateDibSection and am puzzled as
to how to use HDC within the MFC framework. I can't see that CDC returns a
handle, so I am wondering if these two are mutually exclusive. Is there a
bridge between the handle and the class?
"Steve Russell" <firstname.lastname@example.org> wrote in message
> I am attempting for the first time to use CreateDibSection and am puzzled
> to how to use HDC within the MFC framework. I can't see that CDC returns
> handle, so I am wonderin...Japanese Addresses in Contacts
I have Outlook 2007, Japanese language pack is installed (as well as US
english). My wife is Japanese and we are sending out our holiday cards, so I
opened up her calendar pst file in my Outlook to try and mail merge envelope
addresses, and all the Japanese addresses are gibberish ASCII codes.
How do I get outlook to recognize and display the Japapese addresses?
...Strange CDC::MoveTo and CDC::MoveTo performance problem
Hi, I am writing a chart drawing program and encountered a strange
performance problem with CDC::MoveTo and CDC::LineTo function calls.
To avoid flickering, the program does the drawing on a memory device
context(m_DrawDC) and then BitBlt to the real display device. Here is the
void CView::OnDraw(CDC* pDC)
pDC->BitBlt(0, 0, ClientRect.Width(), ClientRect.Height(),
&m_DrawDC, 0, 0, SRCCOPY);
m_Dr...CDC:TextOut and Plus or Minus Sign
I am using MSVC 7.1.3088 on MS XP 5.1 service pack 2.
I am trying to write the plaus or misu sign to a display window using
CDC:TextOut. I can write the symbol to a character buffer using
sprintf(csText, "%s (%c%f %s)", csLabel, 177, fError, csUnits);
which gives me
"Elevation (=B17.926902 Meters)" in csText.
However, when I try to write it to the window using
TextOut(DeviceContext, (int)(pWindowPoint.x), (int)(pWindowPoint.y),
I get a rectangle where the =B1 (plus or minus) sign should be.
Is there a way I can write the PM sign to ...Pb CDC::Arc
I have a problem with this function of the GDI -> CDC::Arc.
The arc is drawn, but there is also a line joining the 2 extremities of
the arc. I don't want to have this line.
Thank you for your help,
Arc should not do this. Perhaps you could show the code where you are
drawing the arc?
Abstrakt Mekanik AB
"Christophe Jacquelin" <email@example.com> a �crit dans le message
> I have a problem with this function of the GDI -> CDC::Arc....Japanese menus
Operating System: Mac OS X 10.5 (Leopard)
I bought a Mac because of the ease of switching languages. My wife is Japanese and I want to be able to switch languages on the menus for her in Office like the system switches. Is this possible?
> I bought a Mac because of the ease of switching languages. My wife is Japanese
> and I want to be able to switch languages on the menus for her in Office like
> the system switches. Is this possible?
Have you considered setting up a new User for your wife. It's so ea...trouble with CDC
I'm doing a program that needs to capture bitmaps off a window of another
program. I'm doing okay except I have an intermittent failure. I admit I'm
not testing for all the possible MFC error returns at this early stage, but
even I did I'm not sure how I'd deal with this error.
My piece of code looks like this.
void CMyDlg::GrabRect(CWnd *pWnd, CRect rc)
CDC * pSourceDc = pWnd->GetDC();
Sleep(50); // !!!!! need this or the crash happens almost right away
I'd like to select bitmaps into a device context
created by CreateCompatibleDC. My problem is
that if I select a bitmap stored in a CImageList,
the result from SelectObject is Null indicating
failure. But if I select a bitmap loaded with
LoadBitmap from a resource, I can select it
into the same DC without problems.
What am I doing wrong? Any suggestions
At the point where you select the bitmap, it needs to be a valid bitmap. You have not
shown the code you are using, so it is hard to tell what you have done.
On Fri, 5 Dec 2008 02:51:42 -0800 (PST), F...Transferring control of CClientDC to CDC
I have a class MSWinDisplayManager which I want to take a CClientDC
context so that it's member functions can perform drawing routines on
I want the class to have it's own CClientDC member which all the
have access to draw on. My constructor looks like this:
This is called by the user like:
then I want to do things like:
The problem I have is that private_win isn't getting control of the
Has anyone had problems with the screen flickering using the CDC member
fuction "TextOut", with an update rate of 1000 Hz using on-screen counters in
the View's OnDraw() function, or anything else ?
On Mon, 12 Mar 2007 02:13:18 -0700, C Hill MBSC
>Has anyone had problems with the screen flickering using the CDC member
>fuction "TextOut", with an update rate of 1000 Hz using on-screen counters in
>the View's OnDraw() function, or anything else ?
If I reca...CDC::SelectClipRgn
I have to draw a line (using MoveTo and LineTo) that has to be clipped to a
portion of the screen.
The starting and ending coordinates are on opposite ends outside the visible
Clipping it does the trick of showing only a portion of the line within the
area it is supposed to draw in.
When using a printer DC to print (standard print preview of an MDI
application) the clipping doesn't seem to work, so the line gets drawn all
over the place.. even outside the paper boundaries in print-preview.
What can I do about this?
It would be quite a hassle to have to calculate the 'inte...CDC same as CClientDC
Are they the same?
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 8.04.1) Linux 188.8.131.52
^ ^ 12:38:01 up 4 days 21:28 3 users load average: 1.03 1.03 1.00
? ? (CSSA):
Not exactly, no. CClientDC is derived from CDC.
"Man-wai Chang ToDie (33.6k)" <firstname.lastname@example.org> wrote in message
&g...why i can not use CDC::TransparentBlt
I am using VC 6.0 sp6
the sdk is the most latest
but when i use CDC::TransparentBlt
the complier report error
the error message is:
G:\myproject\game004\Man.cpp(72) : error C2039: 'TransparentBlt' : is not a
member of 'CDC'
d:\program files\microsoft visual
studio\vc98\mfc\include\afxwin.h(636) : see declaration of 'CDC'
Error executing cl.exe.
Exactly what error do you get?
Nish [VC++ MVP]
"howyougen" <take..email@example.com> wrote in message
Ok this is really starting to mess things up for me and ive searched the msdn
library until my head hurts, so ive decided to ask you guys. Theres two
things im having problems with:
1) Copying an image to a temporary CDC, then stretching it onto another CDC.
For example this code generates runtime errors for me (while if i use
this->GetDC() it does not):
CDC dcImg, dcTemp;
dcTemp.StretchBlt(0, 0, 250, 250, &dcImg, 0, 0, 100, 100, SRCCOPY);
2) this->GetDC() will not let me change the brush, p...CDC::m_hAttribDC
I still have to see a purpose for this data member. With the exception
of CMetafileDC, m_hDC is always equals to m_hAttribDC. In my
applications, all it does is adding overhead in all the functions that
first check if (m_hDC == m_hAttrib) and then check if ( m_hAttrib !=
Does someone has a concrete example of where m_hAttribDC is actually
The attribute DC is also used for print previews. I assume you are doing
something really bizarre if you often need to check equality the way you
Abstrakt Mekanik AB
One of the common shapes that seems to be missing from the CDC members is
the arrow. Is there a good way to do arrows? I need to create arrows around
the circumference of a circle pointing toward the center of the circle. Any
hints on how this is best done?
www.Newsgroup-Binaries.com - *Completion*Retention*Speed*
Access your favorite newsgroups from home or on the road
I'm not sure if CDC has any line caps. In the past I used GDI+ to draw
arrows and different kind of line caps.
IMHO, the default line caps don't scale very well, so ...CDC/HDC????
I am trying to develop a print screen utility for a windows CE program.
I am writing it in Embedded VC++ and running into some weirdness.
My plan of action is to use GetClientRect() to find the location of the
window, then loop through each pixel in that region and perform a
GetPixel() to get the RGB value.
My problem is that I need a HDC in order to perform GetPixel(). I used
GetActiveWindow() to get an HWND, then used FromWindow() to get a CWnd
pointer. I then tried the following line to get an HDC.
When I compile though I get the following error.