|
|
I've installed the latest SDK, how can I updated the vc6 include file? Just copy those files? Thx.
mIchAel Liu
|
|
|
|
|
I feel like I'm missing something - I just try to load a text file into an Multiline EDIT, modify it, and save it again as text file. (should match notepad's behavior of hard line breaks)
Issue: just taking the file size and loading does not work because of the \n <--> \r\n conversion. For saving, it seems to double the line breaks, so it's bad again.
All I came up was either reading line-by-line, or reading as binary and do the replacements on my own. Which sounds a bit awkward.
Any suggestions?
TIA
Peter
We are ugly but we have the music Leonhard Cohen [sighist]
|
|
|
|
|
1) I tried putting the following:
CNewDialog cDlgNoOk;
cDlgNoOk.m_edit1.SetFocus();
Got a debug assert when it ran.
2) Then I tried putting it in the constructor- still asserts:
CNewDialog::CNewDialog(CWnd* pParent /*=NULL*/)
: CDialog(CNewDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CNewDialog)
none = NULL; // NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_edit1.SetFocus();
}
3)Finally I put it in :
BOOL CNewDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_edit1.SetFocus();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
It ran without asserting but the editbox didnt get the focus.....
Any suggestion on how to set the focus?
Thanks,
ns
|
|
|
|
|
please read:
>>
m_edit1.SetFocus();
return TRUE; // return TRUE unless you set the focus to a control
<<
We are ugly but we have the music Leonhard Cohen [sighist]
|
|
|
|
|
I'm going to start reading the comments from now on! THanks so much for pointing me to it...
ns
|
|
|
|
|
Hi all.
Since we have written our own web server, our setup has to detect if there is already a application listening on port 80, so we can notify the user about the conflict. How can I get this information?
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.
|
|
|
|
|
try bind()ing to the port and if the call fails then something is already on that port. u can however set a socket option to reuse it
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
Brian Azzopardi wrote:
try bind()ing to the port and if the call fails then something is already on that port. u can however set a socket option to reuse it
I already know this. But I want to know the process which uses this port. Thank you anyway
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 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.
|
|
|
|