|
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.
|
|
|
|
|
I am developing an application ( ham radio) which is getting out of hand as far as number of files.
I would like to split it into a main program and dll's and see if it can be better managed.
I like to keep my development it separate directories - each with its own supporting sub directories.
For example I keep “Archive” sub directory of last few copies of my program – just in case I goof - up, which I frequently do.
So I tried DLL and found out that all the code samples people use are always copying the resulting files into the parent application directory – and things get back to a mess.
On top of that I use my least favorite application - Visual Source Safe- and it got into the act and refused to “access” DLL .h file without coping it into the parent directory also.
The result – even if parent and DLL are set as dependent project in workspace – adding function into DLL does not change the include file copied by VSS. ( I know it does not make much sense, but..)
So, anybody has a real life example how to organize “big” project as far as old faithful DOS directories structure?
I did try full path in DLL #include file , but that would probably get even messier down the line.
And the compiler did not like full path for the DLL library either.
Any constructive suggestions are as always appreciated.
Thanks for your time.
Vaclav
|
|
|
|
|
I assume that you are using some version of Visual Studio or VC Express.
I usually find that if a project is getting too large it can often be split into a main application and a number of supporting libraries. The libraries can be DLL or static depending on your requirements. I would then make the main app and each library into a separate project within a single solution. This way all your source files will be automatically created within their own individual directory trees. I use CVS for source control which manages such a structure quite happily, and allows access at any level from individual file to total solution. I expect most other SCS packages do the same.
I expect it would also be not too difficult to split a single large project's source files into separate directories as you describe above. I have done something similar in the past with VC++ Express, and not had any problem building it.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Thanks Richard,
you got the idea. I am using VC++ 6.0 ( and I am OK with it).
And yes, I got multiple project, each in its own directory.
I just did some more search and found out about pre-link , post-link steps.
I think i could use that to link the directories properly.
So for I have no clue how to do it, but I'll keep working on that.
Vaclav
|
|
|
|
|
I think I got it.
If I put DLL project in same directory as main project the #includes and the library "path" are pretty simple.
Now I need to
a) figure out why I do not need to run regsvr32 to register the dll.
( I am still running Windows 2000 nad I am relatively happy with it) The compiler / OS is happy when I just copy the DLL into windows /system32 directory.
b) How to keep this dll updated - I still think the post/pre link could do it.
|
|
|
|
|
Vaclav_Sal wrote: a) figure out why I do not need to run regsvr32 to register the dll.
As I understand it, you are producing a plain vanilla DLL, not a COM server. Windows does have to be able to find it to load it, but it does not need to be registered for activation via COM protocols.
I also believe that for a "private" DLL such as you are using, it is now considered preferable to keep it in the same directory as the exe, rather than adding it to windows/system32 ( or using a manifest and putting it someplace shared by all your exe's).
You might want to look at this[^].Please do not read this signature.
|
|
|
|