|
I also would like to learn how to do it. I am trying to show the ports in use and which processes are using them.
Orcun Colak
|
|
|
|
|
I've only found a solution for Windows XP: AllocateAndGetTcpExTableFromStack in iphlpapi.dll (found in the sources of Netstatp at Sysinternals)
Regards
Thomas
Sonork id: 100.10453 Thömmi
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
I see hoew to get the oh-so useful document pointer a lot, but if I want to destroy view2 from view1, how do I do that? If I had launched a dialog from my view, then I'd have the name like:
CMyDialog cDlg;
etc
cDlg.DestroyWindow.
But I didnt spawn view2 from view1, so how to I get its name or pointer to call DestroyWindow on it?
Thanks,
ns
|
|
|
|
|
You still need to go via that magic document. The document keeps pointers to all its views, which you can get access to via CDocument::GetFirstViewPosition() and CDocument::GetNextView() (which uses MFC's less than intuitive POSITION based iteration method - look the two methods up in the MSDN Library for details).
You can either call those methods from one view (using the view's pointer to its document) to destroy the other view, or you can define a method in your document which you call from one view to close the other. I prefer the second method, because it means the views don't have to know too much about the views they coexist with.
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
I've created Win32 app (not console app) n' I wanna change the EXE icon
to one of my own.
Help, por favor.
10XXXXXXX x 2
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
I´d try this :
HICON hLargeIcon = LoadIcon ( hinstYourModuleInstance,
MAKEINTRESOURCE(IDI_NEW_ICON) );
HICON hSmallIcon = (HICON) LoadImage ( hinstYourModuleInstance,
MAKEINTRESOURCE(IDI_NEW_ICON),
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR );
SendMessage ( hwndYourWindow, WM_SETICON, ICON_BIG, hLargeIcon );
SendMessage ( hwndYourWindow, WM_SETICON, ICON_SMALL, hSmallIcon );
taken from this FAQ.
~RaGE();
|
|
|
|
|
During the initialization of your app's main window, you can load an icon from your resources like so:
<br />
WNDCLASS wc;<br />
<br />
wc.lpfnWndProc = (WNDPROC)MainWndProc; <br />
wc.lpszClassName = _T("MyAppClass");<br />
...<br />
wc.hIcon = LoadIcon( hInstance, IDI_APPICON );<br />
...<br />
<br />
if ( ! RegisterClass( &wc ) )<br />
return FALSE;<br />
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
My app has no windows. I just want to change the default icon of the apps
EXE file. That's it.
I dare you all to solve this puzzle the SDK's way!
10XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
Add a resouce file (*.rc) to your project. Insert an icon (the one you want to use). Compile your application. If you import more than one icon, the compiler will arrange the icon resource ID's in alphabetical order. The first icon will then be associated with the EXE.
BlackSmith wrote:
I dare you all to solve this puzzle the SDK's way!
No SDK involved!!
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
Hello,
If I want all views to update, its UpdateAllViews(NULL);
All other views but the sender -- UpdateAllViews(this);
What do I do if I want to update only my current view and none of the others?
Thank you very much,
ns
|
|
|
|
|
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().
|
|
|
|