|
I think that no more than one application can bind to a given port at the same time.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Thanks,
since the port number is 0 here, doesn't that mean that it will attempt recv. from all port numbers?
|
|
|
|
|
Dave_ wrote:
since the port number is 0 here, doesn't that mean that it will attempt recv. from all port numbers?
Hm... have you tried using port 0?
You can't bind to port 0!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Yes, I have tried - we have software that has been running for years this way. The problem came up when another application sent/rcvd UDP messages at the same time. I'm guessing that they are using the bind with port 0 also (for the rcv socket), and they are getting some of the UDP messages that were meant for us.
|
|
|
|
|
Aah.. but then it must be specific for the UDP protocol to bind on port 0!
I don't know UDP that much.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Thanks anyway. Maybe I will post another message with UDP and port 0 in the heading. This is very difficult to find any information on since 90% of programmers are using TCP instead.
|
|
|
|
|
Dave_ wrote:
Maybe I will post another message with UDP and port 0 in the heading
Don't do that!
It's a bad thing to re-post a message, if you have bad luck someone will give you a lesson...
But click the "Modify" link in your message and change the subject!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
as far as I know, trying to bind to port 0 using UDP will just make it pick its own port that isn't already allocated. You can't have 2 programs running using the same port.
http://www.ecst.csuchico.edu/~beej/guide/net/html/syscalls.html
Its for linux but its the same case as far as I've tested (lots in the last month) as winsock. I've just finished a biggie UDP based program and wouldn't let it try to bind to port 0 if my life depended on it, I'd rather know where it was going thanks
|
|
|
|
|
I need some help. I need source code that will recursively search the registry and delete text found. It would need to work on 95/98/NT/XP/2000. I'm looking to return a list (perhaps in a list box) of all keys (ALL TEXT) that were found. If that Text appears anywhere in registry I want it added to my list. Then I can select/deselect what I wish and then delete the selected items. Allow someone to highlight and delete specific ones.
Any ideas?
Any help is appreciated.
Cheers,
Derek
|
|
|
|
|
try this:
HKEY hKey = NULL;
CString csCadenaA[10];
CString csCadenaB[10];
csCadenaA[0] = "Software\\akuna\\matata\\";
csCadenaB[0] = "LionKing";
csCadenaA[1] = "Software\\lilo\\stitch\\";
csCadenaB[1] = "ls";
for (int i=0;i<10;i++)
{
RegOpenKeyEx(HKEY_LOCAL_MACHINE,csCadenaA[i],0,KEY_ALL_ACCESS,&hKey);
if (hKey != NULL)
{
RegDeleteKey(hKey, csCadenaB[i]);
}
}
OK, the strings used in this sample are stupid, but it works...
Hope this helps...
|
|
|
|
|
How do I specify an Icon and a default File Extension to my MDI document ?
Please help
|
|
|
|
|
You can specify an extension in the wizard when you create your MDI project.
The Icon can you just replace, that one you have as standard can you find in the res directory I think. Just replace the icon and TADA!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Once I have created a project how do I specify the extension ?
|
|
|
|
|
I haven't used SDI/MDI or neither MFC for long so I don't know!
Someone else have to take over now!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
In your string table, you will find an entry for IDR_xxxxxxTYPE, where xxxxxx is your original file type. Replace the text in the string to:
\nJunk\nJunk\nJunk Files (*.junk)\n.junk\nJunk.Document\nJunk Document
Where Junk is your document type.
Hope that helps.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Am I missing something? If I want to hook the minimize button, I add an OnSysCommand() method and look for SC_MINIMIZE, right?
What would make my CPropertySheet-derived dialog behave differently? I get the SC_CLOSE, but no SC_MINIMIZE.
J
May the bear never have cause to eat you.
|
|
|
|
|
No no, don't everybody rush to help out.
It turns out that you need to specify the WS_MINIMIZEBOX when you actually create the CPropertySheet-derived window (ie, pDlg->Create(whatever, WS_OVERLAPPEDWINDOW); // <- included in there). Specifying it later did not seem to work.
And using ModifyStyle() in the InitDialog() showed the minimize box, but wouldn't actually allow the dialog to send the associated WM_SYSCOMMAND. Weird.
I lurve MFC.
J
May the bear never have cause to eat you.
|
|
|
|
|
That kind of jogs my memory. I am not sure if this is what you were experiencing, but you need to make a call like this:
::SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | nFlags);
after certain style changes with SetWindowLong in order for the style to be completely set into the window. Maybe the WS_MINIMIZEBOX is one of those styles.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hmmmm. I did a quick check it didn't succeed, but that doesn't mean much.
Thanks for the pointer - it's a useful tidbit to know regardless of whether or not it solves this problem.
J
May the bear never have cause to eat you.
|
|
|
|
|
Hello,
I am looking for the mentioned sysmsg.dll . I was unable to find on my Windows 2000 and it is not included with Visual Studio (I have a service pack 5). Could you please help me (let me know) where could I get it?
Or is there somebody who has it (perhaps with a lib and header if required) and could send it to me?
Thanks
|
|
|
|
|
I'm currently building a ListView control that is able to be edited in-place. So far I've got an edit control working, but I'm having problems with a spinner control.
The first problem is I can't set the focus to the spinner control after I've created it. I tried using the same method (SetFocus()) I used for the edit control but doesn't work.
The second problem is I can't trap when the 'Esc' or 'Enter' are pressed. For the edit control I'm using PreTranslateMessage(), but it's not getting called when the spinner is created.
Anybody no what's going on? Have an examples I can take a look at?
Thanks
Chris
|
|
|
|
|
the program has a view,
there are 2 Splitter Windows.
i will open a file in the 2 Splitter Windows.
one is hex. one is txt.
i feel good.
|
|
|
|
|
it must be choose one file ,
and open it in 2 Splitter Windows and in the same time.
i feel good.
|
|
|
|
|
for hex, open as ios::binary, for text, ios::text
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
i have seen a code that is
class CHexEditCtrl : public CRichEditCtrl
it change CString to Hex,but it is in a EditCtrl.
i want open a file in a View
i can write a class
which public CView as --- class CHexEditCtrl : public CRichEditCtrl??
i feel good.
|
|
|
|