|
I was expecting to see the function UpdateAllViews in the classwizard entries for my doc class. There are functions like: setPathName, setTitle, GetNextView etc but not UpdateAllViews. Since its a CDocument object I can look in the MSDN for members, but why doesnt the class wizard have a list of all member functions, not just some? Why are the ones that are there, there?
Thanks,
ns
|
|
|
|
|
call OnUpdate directly
(UpdateAllViews just calls OnUpdate for all views 8except the sender (if given)))
We are ugly but we have the music Leonhard Cohen [sighist]
|
|
|
|
|
Hi,
Can any one give me a link to any article on Socket programming in C++(or C). Or any book which covers this topic. I want to do Socket programming in C.
Kindly help...
Tnx
vini
|
|
|
|
|
vin wrote:
Can any one give me a link to any article on Socket programming in C++(or C).
http://www.codeproject.com/internet/winsockintro01.asp
http://www.codeproject.com/internet/winsockintro02.asp
http://www.codeproject.com/internet/winsockintro03.asp
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Richard Stevens has published the 'bible' on socket programming. Get TCP/IP Illustrated Volume 1 (I've got all 3 volumes). Easy to understand and a great book to learn TCP/IP network coding.
HTH
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
Brian Azzopardi wrote:
Richard Stevens has published the 'bible' on socket programming.
I agree. His books are outstanding. Another one that has been very helpful to me is Network Programming for Windows by Anthony Jones and Jim Ohlund.
marshall
If you continue to do the same things you always did, don't be surprised if you get the same results you always got.
|
|
|
|
|
By default, clicking on the item text in a listcontrol with extended style checkboxes, does not set the check in the checkbox. How do I make it so that when I click on the name, the check is set and the app responds as if to an actual direct check in the checkbox?
Thank you.
ns
|
|
|
|
|
You can't make the list control do that automatically (there's no style bit or extended style bit to do it) so you'll have to add some code.
You need a notify handler for NM_CLICK. If the user left clicks on the icon or the first column label, the NMITEMACTIVATE.iItem member will contain the index of the item clicked on, so you can then set the check state of the item.
In MFC, your code will look something like this, assuming you're handling the notification in the parent window of the list control:
ON_NOTIFY(NM_CLICK, ID_YOUR_LIST_CONTROL, OnClickYourListControl)
...
void OnClickYourListControl(NMHDR* pNMHDR, LRESULT* pResult)
{
NMITEMACTIVATE* pItem = (NMITEMACTIVATE*)pNMHDR;
if (pItem->iItem > -1)
{
CListCtrl* pList = (CListCtrl*)CWnd::FromHandle( (pItem->hdr).hwndFrom );
ASSERT(pList!=NULL);
pList->SetCheck( pItem->iItem, !pList->GetCheck(pItem->iItem) );
}
*pResult=0;
}
If you're handling the notification in the list control itself, you'll need to use the reflected message instead, via the ON_NOTIFY_REFLECT macro.
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
Thanks so much for the direction. I am trying it out. For the checkboxes I have:
m_list3.SetExtendedStyle(LVS_EX_CHECKBOXES);
where m_list3 is a listcontrol.
Thanks a million again,
ns
|
|
|
|
|
Hi,
I need to have the MDI MFC app start with two different views already populated with data. I only have one document. How do I code my app so that when it starts, both the views will be instantiated?
Thank you.
|
|
|
|
|
How can I make a CWnd-descended child window which has a Z-order placing it beneath its CWnd-descended parent window?
|
|
|
|
|
Have you already tried something with SetWindowPos() (Throw an eye in the MSDN for further infos) ?
~RaGE();
|
|
|
|
|
Yes, I looked into SetWindowPos(). The problem is that when SetWindowPos() changes the Z-order of a window, it automatically changes the Z-order of any windows owned by that window. So if I tell it to put my main window in front of a child, it does it and then puts the child in front of the main window again.
|
|
|
|
|
Hi all,
Is there any class to list all my Directories,Folders and the files in that folders and Network mapped drives in a drop down combo box?.Kindly help me.
With regards
Shibu K.V.
Senior Research Associate.
VLSI ASIC Hardware Design Group
Electronics R&D Centre,Trivandrum
India
|
|
|
|
|
There is no.
It's better way to invoke standard Open Dialog by GetOpenFileName().
|
|
|
|
|
Hi all,
How can i get the back ground colour of a dialog?
With regards
Shibu K.V.
Senior Research Associate.
VLSI ASIC Hardware Design Group
Electronics R&D Centre,Trivandrum
India
|
|
|
|
|
COLORREF rgbBackground = GetSysColor(COLOR_WINDOW);
|
|
|
|
|
Try to declare a template class as below, But it can't pass the compiling.
(Using MS VC++ 6.0)
template < class ClassType, typename DataType > class MyContainer :
public ClassType < DataType >
{
...
}
only while I change it to something like this, it works.
template < typename DataType > class MyContainer :
public vector < DataType >
{
...
}
But my purpose is to support vector, list, queue and deque in a single
template class. Does anyone know how to make it?
Any commment greatly appreciated!
Wayne King
10 Jul 2002
|
|
|
|
|
In the example that doesn't work, you are using a template parameters ClassType as a name of a class as well. There are going to be some problems with trying to create a template this way. For instance the ClassType template parameter also needs a parameter to it as well. The only way I could get it to work is as follows:
template< class T, class D>
class MyContainer
{
public:
MyContainer() : T<d>
{}
virtual ~MyContainer() {}
};
typedef MyContainer<vector<int>, int> MyIntContainer;
|
|
|
|
|
Hi Terry Denham,
Soory I didn't get you. Is your messgae intact?
Could you please reply again?
Wayne King
10 Jul 2002
|
|
|
|
|
I want to change the scroll lines number in Windows98(system wide).
But it does not work. Could you please give me a hand ?
Below is my code:
int num = 10;
SystemParameterInfo(SPI_SETWHEELSCROLLLINES, num, NULL, NULL);
The same code works in WinMe, Win2000 and WinXP.
Could you please give me your ideas?
Thanks for your help.
|
|
|
|
|
i am having problem in loading a bitmap in a rectangle contained in a dialogbox. anybody having idea what to do or any sample code
|
|
|
|
|
I generally make a CStatic box with a border and then create a new class which is a child of CStatic. For example, class CBitmapViewBox : public CStatic
I add a member variable of type CBitmapViewBox to my main dialog and, in the OnInitDialog() event, I do this...
<br />
m_BitmapViewBox.SubclassDlgItem(IDC_SBITMAPDISPLAY, this);<br />
m_BitmapViewBox.Init();<br />
To load and display the bitmap, I do this...
<br />
void CBitmapViewBox::OnPaint() <br />
{<br />
CPaintDC dc(this);
CMainViewDlg *pWnd = (CMainViewDlg *)GetParent();<br />
<br />
if(pWnd != NULL)<br />
{<br />
if(m_bValid)<br />
{<br />
CRect lRect;<br />
GetClientRect(lRect);<br />
lRect.NormalizeRect();<br />
<br />
BITMAP bm;<br />
m_BMP.GetBitmap(&bm);<br />
CBitmap *pOldBitmap = dcMem.SelectObject(&m_BMP);<br />
<br />
dc.BitBlt(0, 0, lRect.Width(), lRect.Height(), &dcMem, 0, 0, SRCCOPY);<br />
<br />
dc.SelectObject(pOldBitmap);<br />
}<br />
else<br />
{<br />
dc.DrawText("Not a valid BMP file", -1, lRect, DT_CENTER | DT_VCENTER | DT_WORDBREAK);<br />
}<br />
}<br />
<br />
CStatic::OnPaint();<br />
}<br />
<br />
BOOL CBitmapViewBox::UpdateBMP(LPCTSTR lpszName)<br />
{<br />
CMainViewDlg *pFrameWnd = (CMainViewDlg *)GetParent();<br />
HBITMAP hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), lpszName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);<br />
<br />
m_bValid = TRUE;<br />
<br />
if(m_BMP.DeleteObject())<br />
m_BMP.Detach();<br />
<br />
if(!hBitmap)<br />
{<br />
m_bValid = FALSE;<br />
UpdateSize(m_iMaxWidth, m_iMaxHeight);<br />
Invalidate(TRUE);<br />
return FALSE;<br />
}<br />
<br />
m_bValid = TRUE;<br />
<br />
m_BMP.Attach(hBitmap);<br />
}<br />
|
|
|
|
|
Is there a good book on this planet about the core WINApi, how it works, and how I can work with it. I have to use the ol' famous help or MSDN, but I'm wasting paper on it (Printing), and it's not always that clear (No samples, etc...)
Sjoerd
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
there is a good book in the market its something like Win32API programing with visual basic and does have samples
live and let them live
|
|
|
|