|
is it possible to write a multi-thread multicast server?
that mean one server can have many multicast group and serve different client?
any reference website about it??
thanks a lot!
|
|
|
|
|
Sure, why not? You can make a program do practically anything you want. Search CP for examples, or google the net with appropriate keywords. Mostly, if you use the same multicast port for the different threads handling different clients, send some sort of identifier (client name/version, etc.) so the proper thread can process it and others can drop 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-----
|
|
|
|
|
Is it possible to call functions in a C# dll from C++ code? If so, what do I set in the build properties of the C# dll to create the .lib the C++ code needs?
|
|
|
|
|
Tom, you may find my article Creating a CCW for COM enabled non .NET applications[^] helpful, it explains how to do this.
- Nick Parker My Blog
Last time I checked, all programmers have selective ignorance. I know nothing about 3D graphics. I know a lot about COM. VB gets under people's skin because one can be ignorant of computer architecture and ASM and still get a lot done. - Don Box
|
|
|
|
|
My network is broken and has dynamic IPs. Not all computers can be seen and accessed by their names.
Is there a way to identify a server (or a computer) in such environment? I know that the best solution in my case is upgrading all computers to WinXP but that's not the issue now. That case makes me think if it is possible somehow to detect/identify specific computers (especially) servers quickly and reliably?
Any ideas?
|
|
|
|
|
|
I think this problem not in C#. You should get it into NetWork room.
Live for programming
|
|
|
|
|
|
The question you are asking is really a very complex one, especially if you have no network internals knowledge. If it is a Windows network, the machines could be in a different workgroup (if you are workgrouping) or in a different domain (if you are doing domains).
If everyone including the servers are in the same group, and you cannot see half the machines, then it could very well be an internal router problem (if you have a large network and are using routers with virtual networks).
Also if you have a dynamic network, as in everyone uses DHCP, then the issues can be anything from the machines being misconfigured and do not see the DHCP server or someone really screwed up and there are two DHCP servers alive with completely different subnets defined. In that case your network is screwed up and needs to be fixed.
If you can only see half the machines in the network using your machine, than no software you write will ever see the machines either. Server discovery (asking to get a response of who is on the network) would be a stupid thing to incorporate into a base development language since it would open a HUGE barn door to hackers everywhere. (ala, the heist of the HalfLife 2 source code but much worse)
In previous applications I wrote code that worked with a specific sequence of servers (basically a primary and fallback server). I'd try to connect to primary. If an exception was raised that indicated no response, I attempted to connect to the fallback server. If I could not connect to either, then the application would not run.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
i am using an application that trying to get the URL from a browser running on the client
|
|
|
|
|
Try to keep this in one thread (and watch out for initial double posts).
The best way I can think of off the top of my head is finding the window for the address bar. Tthis will be a child window of the application's main window (or a child of a child, etc.). Take a look at the Spy++ application if you have Visual Studio installed. Basically you can use it to find windows and look at their properties. Once you find the window, you can look at it's properties and get the text within it.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
hi
would any body tell me how i can read URL written in browser bar
|
|
|
|
|
Need a little more info...
Do you mean server side (getting the URL of the page basically)? Are you an application trying to get the URL from a browser running on the client? Are you hosting a web browser control?
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
hi
would any body tell me how i can read URL written in browser bar
|
|
|
|
|
From a Browser Helper Object (BHO), you get the IWebBrowser2 information from the IUnknown passed to your implementation of IObjectWithSite::SetSite and check the IWebBrowser2::LocationURL . From a separate application, get the Windows handle (HWND ) of the Internet Explorer application (use Spy++ to find class information, but don't use the HWND s there because they are allocated with every Window) and P/Invoke the native FindWindow function to get the Window with that WNDCLASS . Find the window class of the Address bar, then get that window and get its text by P/Invoking GetWindowText .
-----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-----
|
|
|
|
|
If someone could shed some light on how to communicate with a usb/hid device. Also, where I can find some more information on the win32 api.
What I have is a magnetic card reader that connects to the usb port and windows picks it up as a hid device. I need to be able to recieve information from this device directly into my application, which is written in C#.
Thank You,
Nits
|
|
|
|
|
What magstrip reader are you using? Don't they provide an API of some sort?
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
The mag card doesn't come with a driver. It actually uses the builtin HID driver from windows.
Thank You,
Nits
|
|
|
|
|
So does it simply act like a USB keyboard and send the magstrip data like it was typed in?
Do you have a model number so I could take a look at what you're using? I've used a few different products before (both MICR, magstrip, and a combination). I've seen magstrips that act like a keyboard and simply type the numbers in when you use them and others that are much more complicated.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
I typed "HID" into MSDN Online and found quite a bit of information. This is not a simple / short solution and isn't really appropriate for a forum. You should read the documentation provided in those links.
As far as using C#, you might be better off writing a native module. You'll have to P/Invoke a LOT of native functions and recreate many structs, as well as define many preproc defs. If you use a native library with your app, you can make a few simple functions that you can P/Invoke that wrap the functionality you need, thus saving you development times and costs (if applicable).
For more information on P/Invoking, see the .NET SDK documentation for DllImportAttribute .
-----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-----
|
|
|
|
|
Hi all
i have some prolvlems with tree :
- it will be flicker when the user resize a window contain a treeview
- when you minimize the application and re maximaize it somethimg strange will happen to the drawing event, sometimes it draw gray rectangulers ??!!
- the last thing when you select any unselected node in the tree by right click the node will get the selection when your mouse button is down but when you releas the button the selection will rerurm to the last selected node in the tree ??!!!!
so if any body can help me with this three things i will be thankful
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
mhmoud rawas wrote:
it will be flicker when the user resize a window contain a treeview
There are probably more messages sent in relation to drawing a tree than to any other Windows Common Control. There is a LOT involved in drawing a tree. If you don't like this, derive your own and handle drawing in a separate thread, but there's very little you can do with the TreeView provided in System.Windows.Forms.dll. You could also look for a commercial solution like the UltraWinTree from Infragistics[^].
-----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-----
|
|
|
|
|
Oops...didn't finish!
mhmoud rawas wrote:
when you minimize the application and re maximaize it somethimg strange will happen to the drawing event, sometimes it draw gray rectangulers ??!!
If you're doing any drawing, you must make sure that invalidated regions are drawn. Since the TreeView.Paint method is not fired, you must handle this the "Windows way" by overriding WndProc in your derivitive class and handling the appropriate item drawing codes. See the Windows Common Control documentation in MSDN Library for the Tree-View common control class messages and notifications.
mhmoud rawas wrote:
the last thing when you select any unselected node in the tree by right click the node will get the selection when your mouse button is down but when you releas the button the selection will rerurm to the last selected node in the tree ??!!!!
Because a right-clicked node is selected - it is active. The selected node is therefore not changed. This is common among tree controls, even in the Windows Explorer (which, btw, uses the same Tree-View that the TreeView class wraps). Even several other third-party tree controls that I'm aware of work this way - things that are right-click are necessarily selected. This is also common amongh many other UI elements in many different window managers.
-----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-----
|
|
|
|
|
Dear Heath,
Thank you for replay,
as for the paint methode i did not override it any more i have this problems by the default paint method,
and as for the selection changing by right click i have noteced that it is the defualt behavior of the tree view how can we change it to make it selectable by right click
Regards
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
For one, I did not say you should override the OnPaint method (always override the OnEventName methods when deriving instead of handling the events in your derivitive class, but be sure to call base.OnEventName at the proper time). Because the WM_PAINT message works a little differently for the TreeView (and for the ListView too, for that matter), overriding OnPaint won't completely work. It is used to notify the TreeView that different elements need painting.
Also, if you really must change the default behavior of the tree (and you really shouldn't - keeping a consistent interface across the window manager, the majority of applications, and your own application is important for user friendliness), you could override the OnMouseDown method, check to see which mouse button is down, then see if there's a TreeNode under the cursor, setting it as the selected node:
protected override void OnMouseDown(MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
TreeNode node = this.myTreeView.GetNodeAt(e.X, e.Y);
if (node != null)
this.myTreeView.SelectedNode = node;
}
}
-----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-----
|
|
|
|