Thanks WhiteSky for your replies.
Now problem that I am facing is:
in TextOut() method if I have to pass a buffer which consists of some new line (\n) and tab ( \t) characters then this prints ||| for these characters.
So please tell me that how can I handle this problem i.e. when I want to print something in new line.
it worked for me<br />
CString str="Is this a Test \n 123 \n yes it is \n 456";<br />
StartDoc (pd.hDC, &di);<br />
StartPage (pd.hDC);<br />
EndPage (pd.hDC);<br />
EndDoc (pd.hDC);<br />
I want to develop application for internet (client /server) which will send file and data to each other on internet.
What are the Programatic problem that can occur while transfer data on internet ?
(means the difference between the application build for local network transfer and one build for Internet data transfer)
What are the steps to be consider to make it efficient and reliable for Internet ?
I have used the function DeviceIoControl in my application. One of its parameter is IOCTL_STORAGE_EJECTION_CONTROL, but when i compile the class, error shows : 'IOCTL_STORAGE_EJECTION_CONTROL' : undeclared identifier.
Please respond , which includes or libs , i have to add.
I need draw a border color to static Frame control,
I have the code as below but it not work with my testing for static Frame and Window Dialog.
Please see the code and help me for this
void CTestDLLDlg::DrawFrameBorder(HWND hWnd,COLORREF refColor)
// Get the coordinates of the window on the screen
// Get a handle to the window's device context
HDC hDC = ::GetWindowDC(hWnd);
hPen = CreatePen(PS_INSIDEFRAME, 2* GetSystemMetrics(SM_CXBORDER), refColor);
// Draw the rectangle around the window
HPEN hOldPen = (HPEN)SelectObject(hDC, hPen);
HBRUSH hOldBrush = (HBRUSH)SelectObject(hDC, GetStockObject(NULL_BRUSH));
Rectangle(hDC, 0, 0, (stRect.right - stRect.left), (stRect.bottom - stRect.top));
//Give the window its device context back, and destroy our pen
At initialize function I called as bellow:
CWnd* pWnd = GetDlgItem (IDC_AVATAR1);
//and for test more: DrawFrameBorder(this->m_hWnd,RGB(255,0,0))//red
But it seem to not draw the red border
Please help me
Thank in advance!
I assume that you are talking about the GroupBox...
Because the in OnInitDialog you are trying to draw the border, but do you know that the window is hidden at that time. You have to write the drawing code in OnPaint, which is called every time the window needs to be repainted.
Moreover it is not good practice to draw the control from another window. So I suggest you that you should derive a class from CStatic and write the code to draw the border inside it. Then create the member variable from this new class.
- NS -
Last Visit: 31-Dec-99 18:00 Last Update: 20-Jun-21 5:50