|
zahid_ash wrote: What are the steps to be consider to make it efficient and reliable for Internet ?
remember sliding window protocol!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Could you please refere to any sample application that is using sliding window protocol
Thanks
Regards.
|
|
|
|
|
which tool can create 16 and 32 bits bitmap?
I tried windows-paint, coreldwraw and photoshop, they can not create 16 or 32 bits bitmap.
thx
|
|
|
|
|
Is your question in vc? or applications
if vc see BITMAPINFO bminfo;
switch(bminfo.bmiHeader.biBitCount)->24,16,32
and ...
whitesky
|
|
|
|
|
Hi,
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.
Velayudhan
|
|
|
|
|
Hi raj,
Include the following file
ntddstor.h
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
|
Did you include Winioctl.h and ntddstor.h
whitesky
|
|
|
|
|
thanks for ur reply,
I have included WinioCtl.h
but do u know where ntddstor.h is found ?
|
|
|
|
|
|
The definition of the IOCTL_STORAGE_EJECTION_CONTROL is found in the winioctl.h Header which is provided with PlatformSDK of VS2003
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Ok guys, thanks for your respone,
I solved it by including winioctl.h in platform SDK 2003
Velayudhan
|
|
|
|
|
Hi,
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)
{
RECT stRect;
::GetWindowRect(hWnd, &stRect);
HDC hDC = ::GetWindowDC(hWnd);
HPEN hPen;
hPen = CreatePen(PS_INSIDEFRAME, 2* GetSystemMetrics(SM_CXBORDER), refColor);
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));
::ReleaseDC(hWnd, hDC);
SelectObject(hDC, hOldPen);
SelectObject(hDC, hOldBrush);
DeleteObject(hPen);
DeleteObject(hDC);
}
At initialize function I called as bellow:
BOOL CTestDLLDlg::OnInitDialog()
{
CWnd* pWnd = GetDlgItem (IDC_AVATAR1);
DrawFrameBorder(pWnd->m_hWnd,RGB(255,0,0))
return true;
}
But it seem to not draw the red border
Please help me
Thank in advance!
|
|
|
|
|
If this is code, it will not work!
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 -
|
|
|
|
|
in onpaint it doesnt work
whitesky
|
|
|
|
|
Really? You mean whose OnPaint? CStatic or CDialog?
- NS -
|
|
|
|
|
I think maybe problem is OnInitDialog so i tested in onpaint
whitesky
|
|
|
|
|
Oh...
It could be due to, painting of the control is coming after that of the dialog...
- NS -
|
|
|
|
|
huutribk2001,
why dont use from one derived class
i write for button maybe it some helpful to you
void CButton::DrawItem(LPDRAWITEMSTRUCT lpDraw)
{
CDC dc;
dc.Attach(lpDraw->hDC);
...
...
and you can use Framerect or Fillrect and ... in dc
...
dc.Detach();
}
if you want to this way you should derived from your class in example CButton and set OwnerDraw in property from your control
whitesky
|
|
|
|
|
As WhiteSky says, the class is CButton, not CStatic. In my first answer it was mentioned as CStatic...
- NS -
|
|
|
|
|
Yah,
It work with CStatic now,
Mmany thank for help.
Tri
|
|
|
|
|
i have defined in stdafx.h header abt all the versions like win95 ,98 win xp and also winnt its working fine in every os except in WINNT
#ifndef WINVER
#define WINVER 0x0400
#endif
#ifndef _WIN32_WINNT
#define WINVER 0x0400
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0410
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0400
|
|
|
|
|
lately i am finding that I am adding functions in the public space only.. no protected no private.. may be just to access the functions easily.. how may i remove this habbit.
tell me true practical explaination that private or protected are must
pathak
|
|
|
|
|
You can do one thing. Create a variable in the public scope that is critical to your application and you don't want the user to modify value of the same.
If this value gets modified you are stuck.
Don't allow to do this.
You will have to think the criticallity of the variable each time you are going to declare them and at the same time you need to determine their scope
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Practices are making man perfect.
so through practice, u will be perfect.
Reading is a good option to know more and correct our assumptions and mistake and also it will fill the gaps in our knowledge.
If you read Code Complete 2, Effective C++ (or similar books), u will find that what u r doing is absolutly wrong.
Define scope for all classes u r creating.
Fix the interfaces, limit it to a minimum.
The public functions are used to communicate with other modules or object. where are as we are defining private functions for some internal calculation required by other functions in the class.
Suppose there is a function in your class which draws an object in your window. you don't need to share this function to others. because it is only required when a paint message comes in your object and draws the required object. it is limited to your class.
so scope ur object with minimum interfaces. never put internal functions to public, that is nto a good way of pragramming. if it is generic and can be used for others make it public static and meaningful.
Hope u clear.
-Sarath
|
|
|
|