|
|
I had a thought ... write a high speed tcp/ip proxy server to sit 'inbetween' your end-points - it simply needs to add up bytes/packets in/out and present that into in a shared-memory area or such
but thats an extra component ! in reality its doing the same as WinPCAP in stats mode, just from a higher level
'g'
|
|
|
|
|
I was hoping someone knew of an API call that I wasn't able to find perhaps something like:
GetProcessIoCounters or GetIpStatistics or GetTcpTable but I'm not sure if any of these are appropriate.
|
|
|
|
|
well, I have seen a C# way of doing it but cant remember all the steps to capture packets .. my first thought was also that it could cause performance issues on the local machine at least ...
I think they opened a socket for receive, bound something like IP-Address-Any to it and then received all the packets from the network adaptor, mapping the packet receive to an event that they could monitor/wait for ... when the event was tripped that had a packet obkect they decoded the basic fields from - I just cant remember who did it and what the pitfalls were
Actually David Crow has an article here about GetIPStatistics, the best thing to do is 'suck it and see' - if as a standalone it gives you what you're looking for you could look at including his functionality in your program (and crediting him of course) - see More on using IP Helper API’s[^]
'g'
|
|
|
|
|
That article is really nice. I wish I found that in my search when I was trying to do several of those things. Unfortunately the links in the reference section that I wanted to follow were all bad.
|
|
|
|
|
Is the child process yours? If so forget all this fancy stuff and just have the child process report its progress to the parent (or otherwise publish them where the parent can access). Steve
|
|
|
|
|
No, only the parent process is my code. But I do have access to the child via the PID and its handle as well as knowing all the IP addresses involved in the transfers. I don't really care if the answer is totally accurate, but just a general knowledge that the link is alive and continually sending data back and forth.
|
|
|
|
|
Ok. Can you tell us any more about the "child" application? For example, it may be able to split out progress reports to stdout in which case pipes and output redirection could be used. This is just an example, but you get the idea: it may already provide a notification mechanism you can use.Steve
|
|
|
|
|
I have to threat the child process as a black box producer / consumer as one end of a network device. I have full control over launching the process but it must run as a normal independant app.
|
|
|
|
|
Hi
I'm trying to re-enable a disabled button by right clicking on the button. I know that the message is not sent to the parent window for disabled buttons. Is there a workaround solution on receiving messages for disabled controls?
Thanks
|
|
|
|
|
Edit: This is WRONG. I was obviously not thinking. Please ignore it.
I have not tried this. Why don't I tell you my idea and you can tell me if it is right?
( I am presuming that you are using MFC. For win32, you would use window subclassing. )
Derive a class from CButton.
Override OnRButtonDown(). Have it enable the (button) window.
Add a data member of this class to the class of the parent window.
In the parent window, when the button is created, associate it with this data member. If the parent window is a dialog, you can use the DDX mechanism for this - see DoDataExchange and DDX_Control. If you are manually creating the button, do it with this variable's Create() member function.
That's it.Please do not read this signature.
modified on Monday, March 8, 2010 9:57 AM
|
|
|
|
|
Avi Berger wrote: Derive a class from CButton.
Override OnRButtonDown(). Have it enable the (button) window.
I think you're missing the point. If the window (button) is disabled, it won't receive the RButtonDown message.
No, I think the trouble here is the OP is trying to make the button do something the UI design doesn't support; e.g., trying to have a disabled window respond to mouse input.
Two possible solutions.
1) Redesign your UI and provide a checkbox used to enable/disable the button in question. The checkbox would always be enabled.
2) Derive a custom CButton descendant. Add a BOOL data member that would hold status info re: custom disabled/enabled state. Provide an owner-drawn capability that would draw the button in a disabled state if the custom status is disabled, and would draw the button normally otherwise. This way the button could still respond to mouse input even if it was 'disabled'.
Solution 2 is NOT recommended. It'd be a pain to implement, and the button behavior would violate UI standards.
UI standards exist for a reason. Users will be confused and frustrated by non-standard behavior that invalidates their expectations.L u n a t i c F r i n g e
|
|
|
|
|
Thank you. I had evidently taken a vacation from thinking.
I agree with everything you had to say, and a 5 vote for fixing my blunder.
I had a fuzzy image that this could be for some simulator game type of thing where a control might have a lockout to be disabled, or a cover to be opened before being activated. Your solution 1, or hiding the button and displaying a different graphic button in its place, would be a better solution for this.
If I am not mistaken again, the RButtonDown message will go the parent window. The parent window could do hit testing on it (or ask the button object to do so). This approach has the drawback of needing code outside the button object to meddle with its operation. More importantly, it has the UI problems that you pointed out and, as you said, is NOT recommended.Please do not read this signature.
|
|
|
|
|
|
|
I want my application to check if the user has an internet connection and if they don't for it to display a message box. I know you cant figure out the code in the snippet because I need help adding the else statement and message box and any other part of the code. Andrew McIntyre
|
|
|
|
|
To start with:
You are missing a semicolon.
Your call to InterGetConnectedState is not quite right. Please carefully check the helpful link provided to you by emilio_grv. It has all the details you need for this.
Your if statement is an incomplete fragment.
Your if statement is illegally at file scope. It must be contained inside a function.
Since you know how to produce your message box, it should be easy to add that to your relocated and completed if statement.
Might I suggest that a C++ primer might be a good investment for you?
(Edited to fix a glaring grammatical error.)Please do not read this signature.
modified on Monday, March 8, 2010 11:06 AM
|
|
|
|
|
Avi Berger wrote: Might I suggested that a C++ primer might be a good investment for you?
I wish I had a $ or £ for every time I have suggested that. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Richard MacCutchan wrote: I wish I had a $ or £ for every time...
That is easy enough. Write such book and start selling.
|
|
|
|
|
Luc Pattyn wrote: Write such book and start selling.
Hmmm, have you any idea how small my brain is?txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Neuron size isn't important, activity is what matters. Get them all firing well above one kHz. However, keep cool, and avoid a melt-down.
|
|
|
|
|
Well, it appears that I need an English primer.
Richard MacCutchan wrote: Avi Berger wrote:
Might I suggested that ...
I didn't notice that grammatical issue in my post until you quoted it. I know better than that. I can't believe the number of errors I keep finding in my own posts.
It's urgent! Where do I send my $ ? If I don't get help soon, I may just convince myself that illiterate become have me. Please do not read this signature.
|
|
|
|
|
Avi Berger wrote: illiterate become have me.
A well formed Yodaism. Well, maybe except for the "me" part.You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Avi Berger wrote: Might I suggested that a C++ primer might be a good investment for you?
It's a shame I no longer maintain the 'CP's memorable quotes' thingie.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Please be polite: don't remove posts that have already been answered.
This is not a private conversation: let further readers to be able to figure out what we are talking about.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|