|
It can't be a routing problem since there is no routers at all.
It is simply the stupic computer choose randomly to what connection (or nick card) it sends its data.
Ex: I have 2 nick cards. With 2 assigned adresses:
192.168.0.1
and
169.254.111.190
The i send my multicast packet, but i never know which one it will uses.
Since my internal network passes throught 192.168.0.1, it it uses the other nick card, i had just send my message god know where.
Thus i need a way to either send the message to both of them or to choose which one.
(Windows is simple for people who use it for internet word and emails, but it is a constant headache for experts )
|
|
|
|
|
"routing" has to do with a route table, not necessarily a router (which is really just a hardware device with a programmable route table and is dedicated to routing packets). TCP is configured to route packets through a particular network interface card (NIC) depending on the destination address. Any computer with a TCP stack uses a route table.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
try this:
D:\Documents and Settings\lepp>netstat -r
Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 50 56 c0 00 08 ...... VMware Virtual Ethernet Adapter for VMnet8
0x3 ...00 50 56 c0 00 01 ...... VMware Virtual Ethernet Adapter for VMnet1
0x10005 ...00 05 1c 05 9c 67 ...... Realtek RTL8139/810X Family PCI Fast Ethernet NIC
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.2 20
62.47.38.202 255.255.255.255 192.168.0.1 192.168.0.2 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.0.0 255.255.255.0 192.168.0.2 192.168.0.2 20
192.168.0.2 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.0.255 255.255.255.255 192.168.0.2 192.168.0.2 20
192.168.213.0 255.255.255.0 192.168.213.1 192.168.213.1 20
192.168.213.1 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.213.255 255.255.255.255 192.168.213.1 192.168.213.1 20
192.168.225.0 255.255.255.0 192.168.225.1 192.168.225.1 20
192.168.225.1 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.225.255 255.255.255.255 192.168.225.1 192.168.225.1 20
217.84.117.73 255.255.255.255 192.168.0.1 192.168.0.2 20
224.0.0.0 240.0.0.0 192.168.0.2 192.168.0.2 20
224.0.0.0 240.0.0.0 192.168.213.1 192.168.213.1 20
224.0.0.0 240.0.0.0 192.168.225.1 192.168.225.1 20
255.255.255.255 255.255.255.255 192.168.0.2 192.168.0.2 1
255.255.255.255 255.255.255.255 192.168.213.1 192.168.213.1 1
255.255.255.255 255.255.255.255 192.168.225.1 192.168.225.1 1
Default Gateway: 192.168.0.1
===========================================================================
Persistent Routes:
None
You can clearly see that each route is properly mapped. Use route to modify.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
But this doesn solve my problem:
Here is the my route table (The good info only).
224.0.0.0 224.0.0.0 65.92.106.225 65.92.106.225 1
224.0.0.0 224.0.0.0 169.254.111.190 169.254.111.190 1
224.0.0.0 224.0.0.0 192.168.100.1 192.168.100.1 1
Currently it uses 169.254.111.190 to send my multicast packets to.
Now if i disable the 169.254.111.190 my routing table would be:
224.0.0.0 224.0.0.0 65.92.106.225 65.92.106.225 1
224.0.0.0 224.0.0.0 192.168.100.1 192.168.100.1 1
and it will send the ulticast packets to 65.92.106.255
IF i disable this lat one i will get:
224.0.0.0 224.0.0.0 192.168.100.1 192.168.100.1 1
and my data would be send to 192.168.100.1
Now if i connect the other 2 i will get
224.0.0.0 224.0.0.0 65.92.106.225 65.92.106.225 1
224.0.0.0 224.0.0.0 169.254.111.190 169.254.111.190 1
224.0.0.0 224.0.0.0 192.168.100.1 192.168.100.1 1
and the data would be sent to 192.168.100.1
Thus you se, depending on some strange criteria, i never know where my data would be send to ?
It can be any of these 3.
224.0.0.0 224.0.0.0 65.92.106.225 65.92.106.225 1
224.0.0.0 224.0.0.0 169.254.111.190 169.254.111.190 1
224.0.0.0 224.0.0.0 192.168.100.1 192.168.100.1 1
I can do like send the data to the first one, but it will create several problems like with Unreal Tournement when you try to play on LAN and can not login.
Thus does anybody know how can i change it using CSharp. (Without disabling all the stuff, to which i will probably not have access anyway in the real world).
|
|
|
|
|
Your net mask seems to be very odd. are you sure you want 224.0.0.0 as net mask for all your connections. Keep also in mind that the network metric is 1 for all your connections. This number is used to decide which connection to choose if several routes are possible the route with the least metric number will be used.
|
|
|
|
|
I only put 224.0.0.0 because it is the only one i care about( multicast mask). The full thing would be too big to display.
I am aware of metrics, but i don't want to modify them since the application i am making is a game and you dont wont a game scrapping all your network info .
|
|
|
|
|
Heyho ppl,
I'm currently trying to figure on HOW I can get a event/test for if an Item in a ListView is beeing displayed on the screen? The thing is I want to display the information only when it's needed (that is, when the users sees it) to optimize speed in very large ListView's.
Any ideas, tips, anything would be most helpfull.
Cheers,
Henrik
|
|
|
|
|
The default implementation of the ListView class doesn't support virtual lists. Instead, you'll have to extend the ListView class with your own class and override WndProc to provide a lot of native concepts. Keep in mind that the ListView control is just a wrapper for the List View common control. There are ways you can do this, but you'll have to P/Invoke functions like SendMessage , create many differents structs, and define many enums or constants that reflect the values of all the Windows messages and notifications. See Windows Controls[^] in the MSDN Library for details. You should be familiar with Win32 APIs and programming.
You could also try searching CP or google the 'net for existing examples. It wouldn't surprise me if anyone has already done this.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Is there a simple way to explicitly get the width of text in a control?
In general, I would like to dynamically size labels, buttons, listboxes, etc. depending on their contents.
I don't have to get the font, draw the text somewhere else and measure it do I?
Thanks,
-Luther
|
|
|
|
|
I think you should check out Graphics.MeasureString
Cheers,
Henrik
|
|
|
|
|
Thanks I was also looking for this.
|
|
|
|
|
That looks like its worth a shot.
I guess, if text on a button spans 2 lines, I need to get the "size" of the button's print area.
That may be different than the size of the button right?
Maybe there is a "client area size" property or something ...
In any case, that call starts me off.
Thanks,
-Luther
|
|
|
|
|
Ok - I know this is a naive question, but where do I get a graphics object.
I am not in an event handler. I am in my custom control's constructor. Its not attached to anything. I just create a button and I've set the Text property, and now I want to set the Size property.
It seems that I can't create an instance of the graphics object ... and this is not a static method.
I'm not a GDI+ expert but I would guess that I can't just create a Graphics object because there is more to the drawing context that must be defined. Where am I drawing? Which window are we drawing to, etc. Maybe I can must measure the string size in the OnPaint handler (using the parameterized graphics object).
Thanks,
-Luther
|
|
|
|
|
Is there a switch to disallow manual text entry into a ComboBox?
Or do I need to catch the KeyPress event and impl this myself?
-Luther
|
|
|
|
|
|
Set the control's DropDownStyle to DropDownList
Charlie
if(!curlies){ return; }
|
|
|
|
|
|
I would like to make the following custom control.
A button, that opens a drop down list. Essentially, a combo box, but I don't want the appearance of a combo box. I want a button.
My initial problem is this. The drop down list may appear outside of its parent's bounds. Imagine a thin panel on the top of a form (like a toolbar) with this control attached to it. The control may have to draw the drop down list ON TOP OF the other controls immediately beneath the toolbar.
I'm used to something like css (position: absoloute). I guess the MainMenu does this. Do I need to custom draw the drop down list control?
Suggestions?
-Luther
|
|
|
|
|
Why not just use a ContextMenu , which is already supported? Just start tracking the ContextMenu in the coordinate space of the container of the Button so that it aligns properly with the Button in question. See the Control.PointToClient method to convert coordinate spaces back and forth. Because the Button.Location is already in the coordinate space of the container, you could also just add the Height and Width appropriately, saving you a lot of work. The ContextMenu control will also extend past the bounds of the container.
Otherwise, you can use a simple popup Window (with the WS_POPUP style when you consider the native implementation of most controls in the .NET BCL). This is all the ContextMenu is when you get the heart of it.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks Heath.
Ddynamically placing the context menu might be just fine.
If I wanted more control over the look of the popup window, I may try the WS_POPUP window approach as well.
But, are you implying that I may have to use some native calls. I've written simple windows programs before - but I'm not exactly sure if thats what you mean.
Would I be on the right track to do this natively by - creating a WS_POPUP window and writing a wndproc to catch mouseover, mouse out and click events? I've seen several posts that link to native DLLs and use SendMessage, etc, so I think I could work this out.
But, I just want to be sure that I'm not missing something ... like, creating a panel in C# and somehow makeing it visible and invisible lower than the button I am using to trigger it. I've tried this - and at first attempt, the panel always shows up UNDERNEATH the controls lower in the client area.
I'm betting I can get that final idea could work if I could somehow make change the panel's z order to higher than the controls lower in the client area. The hypothetical problem I can think of is that the controls lower in the client area don't attach to the same parent, and so, maybe this is recursive so I need to trace back until the parents attach to the same form or root panel, and makes sure the popup menu parent is at a higher z index ...
If you have more time, your suggestions are greatly appreciated. For now, I'm off.
Thanks,
-Luther
|
|
|
|
|
A Panel won't work because it's a child window and nothing more. You have to use a popup window because it must be able to extend beyond its container's bounds. You could use a Form , but there's just too much overhead, IMO.
Yes, what I was talking about was good ol' Win32 programming. Fortunately, .NET can help even there. Remember that all the controls in System.Windows.Forms are just wrappers of Common Controls. There's even classes like NativeWindow that can give you a wrapper to a native window. It wouldn't be too difficult to do. I'm sure there's examples out there, too, although good, specific keywords might be hard to determine.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Perfect. You just saved me a night.
Thanks for the direction.
-Luther
|
|
|
|
|
Hi, Guru
I retrieve procedure parameter information by the code below.
OleDbConnection cnn = (OleDbConnection)idbConn;
OleDbCommand cmd = cnn.CreateCommand();
cmd.CommandText = "procedurename";//Procedure-Name
cmd.CommandType = CommandType.StoredProcedure;
OleDbCommandBuilder.DeriveParameters(cmd);
foreach(OleDbParameter par in cmd.Parameters)
{
MessageBox.Show(par.ParameterName + "\n" + par.Direction.ToString() + "\n" + par.OleDbType.ToString());
}
The problem is the provider not supported and return this error message...
"Retrieving procedure parameter information is not supported by the 'Microsoft.Jet.OLEDB.4.0' provider."
To do this, do you know what provider support.
Sorry for bad English.
Thank you.
|
|
|
|
|
What DataBase are you using ?
Free your mind...
|
|
|
|
|
The Microsoft Jet provider is used to access .mdb files, which are commonly equated with Microsoft Access, though MS Access is not needed to create and use these .mdb files (it's just really handy, and I believe required for forms and reports manipulation).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|