|
John Simmons / outlaw programmer wrote:
Does it appear to anyone here as if the threads could be banging on each other at the point the dialog box tries to handle the messages being passed?
Since you're using PostMessage to communicate with the dialog box, the messages are processed serially. In other words, the threads may be posting messages simultaneously, but they're each processed one at a time by the dialog's message queue. You can verify this by putting TRACE messages at the beginning and end of OnLauncherMsg.
John Simmons / outlaw programmer wrote:
The app does not appear to hang, but for some reason, it thinks an error happened with the app I'm running through ::CreateProcess (specifically, the external app does not appear to ever enter it's Idle Input Loop), and it stops processing that thread. It handles the error gracefully 9reporting the status in the parent dialog's list control, but this also has the effect of shutting down the thread.
That sounds strange. Why does it terminate the thread? Is an exception being thrown somewhere?
Regards,
Alvaro
There are no stupid questions, but there are a lot of inquisitive idiots. -- despair.com
|
|
|
|
|
Alvaro Mendez wrote:
That sounds strange. Why does it terminate the thread? Is an exception being thrown somewhere?
The thread terminates itself because it perceives a problemn with the external app being executed (the external app never appears to reach it's input idle loop).
Like I said, the error is handled in a controlled manner, but the external app appears to be freaking my program out.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
NAV does not do anything until a thread attempts file access. The only interaction your app will have with NAV is when a thread launches an app. NAV will scan that app before allowing it to run.
What kind of error are you getting? Error from CreateProcess() ? Or do you have a timeout waiting for the new app to go idle and the time is expiring? If it's the latter case, the external app could, I suppose, make NAV's heuristics chug away for a couple of seconds if it happens to look like a potential virus. First thing to try is rule out NAV - add an exclusion for the EXE that gets run (or EXEs, if there are several) so they won't be scanned by NAV.
--Mike--
PROCRASTINATION: Hard work often pays off after time, but laziness always pays off now.
BUY MY SOFTWARE!! (please?) RightClick-Encrypt | 1ClickPicGrabber
My IntarWeb Homepgae!!!11
|
|
|
|
|
I sent the guy an email suggesting that he exclude the external app and my program (and it's data files) from the scan to see if that helps.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Maybe it is not the hit, but if you do messaging between Threads: PostThreadMessage, ON_THREAD_MESSAGE.
And my experience that creating a thread can last little while (a few seconds), because the startup is delayed (chached???).
Try this @ home. (B&B)
|
|
|
|
|
You are using WaitForInputIdle to determine when launched
app is finished initializing? I don't see in the docs much
explicit on what the conditions are for this.
So I am guessing that the kernel signals an internal event
or flag when a PeekMessage or GetMessage is called
w/o any messages in the queue. (a guess based on what
constitutes "idle time", never did find good desc. of
what this condition is exactly. Maybe it even polls the
queues while scheduling and flags then?)
Could the problematic app be a console app, or perhaps it
posseses a state where the message queue is never empty?
Can the process handle become signalled before the
"idle time" signals? (maybe it fails or transfers to
another instance?)
So maybe you need to wait with a timeout for input idle
and check the process handle with 0 timeout to see if the
launched app has ended before attending to its message queue.
Just some ideas..
|
|
|
|
|
I've seen some sample code for a ListCtrl TitleTip class here and on codeguru.com. This class will display the full text in a listctrl column when the mouse is hovered over it, in the case that the text is too wide for the column.
However, when implementing the code from codeguru.com, it will not pass any accelerator keys while the tip is being displayed. I've e-mailed the author of the class here on CodeProject.com, and have not received an answer. His code is based on the original code from codeguru.
Just wondering if anyone has a class that will do this and still support keyboard accelerators.
Thanks!
|
|
|
|
|
I have a little problem with the embedded Visual C++ Studio , but I think that's a general problem with the Visual C++ Studio and that's the reason why I am posting this message hear and not in the Embedded/Mobile forum.
So... I have some source code which I use in my Pocket PC application and my Desktop PC application.
I use the following #define so that I can compile it with eVC++ and Visual Studio .NET 2003 :
<br />
#if defined(UNDER_CE) // for Pocket PC application<br />
#pragma message("## Pocket PC ##")<br />
#else // for Desktop PC application<br />
#pragma message("## Desktop PC ##")<br />
#include <rapi.h><br />
#endif<br />
In my Visual C++ .NET 2003 application there is no problem, but in my Pocket PC application I get the following warning:
<br />
Compiling...<br />
MeasureFileList.cpp<br />
## Pocket PC ##<br />
Linking...<br />
D:\windows ce tools\wce300\Pocket PC 2002\include\rapi.h(438): Could not find the file prapi.h.<br />
D:\windows ce tools\wce300\Pocket PC 2002\include\ceapimap.h(197): Could not find the file pceapimp.h.<br />
<br />
LmsPPC.exe - 0 error(s), 0 warning(s)<br />
Downloading files<br />
Failed downloading.<br />
It looks like that eVC++ would include the rapi.h file! But the include command are not in the #if defined(UNDER_CE) section, it's in the #else section.
What's wrong?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
it is looking for prapi.h, not rapi.h
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Yes... and this command is in the rapi.h file:
<br />
...<br />
#include <ceapimap.h><br />
<br />
#ifdef CONN_INTERNAL<br />
#include <prapi.h> <br />
#endif<br />
<br />
#endif // #ifndef RAPI_H<br />
...<br />
It looks like the eVC++ includes the rapi.h (because eVC++ found it!) but can't find the prapi.h file!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Ok, fair enough.
Are you sure the rapi.h file is not being included by another file. try commenting out the #include line and see what happens then. If it still complains then that line is not your problem.
HTH
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Darn, sometimes something that should be easy gets
complicated. I have a modeless dialog that send
messages to its parent window. These are WM_COMMAND
messages for BN_CLICKED, BN_PUSHED, and BN_UNPUSHED.
e.g.
GetParent()->SendMessage(WM_COMMAND,(WPARAM)(BN_PUSHED<<16|nID),0);
To the parent window's message map I have added the
entries:
ON_CONTROL_RANGE(BN_CLICKED,ID_0,ID_N,OnClickX)
ON_CONTROL_RANGE(BN_PUSHED,ID_0,ID_N,OnPushedX)
ON_CONTROL_RANGE(BN_UNPUSHED,ID_0,ID_N,OnUnpushedX)
However, OnClickX is called to for BN_CLICKED, BN_PUSHED,
and BN_UNPUSHED.
I walked through with the debugger and the correct message
is sent (WM_COMMAND with BN_CLICKED, BN_PUSHED, or BN_CLICKED)
but the wrong handler is invoked. (I stopped short of
trying to walk through the CCmdTarget's use of the
message map (that is some seriously ugly code to walk
through.) in the hope that someone will have some knowledge
here.
Am I doing something wrong? missing something here?
I tried changing the order of the message
map entries in case there was a problem
|
|
|
|
|
Ah, I found the problem.
If I didn't pass the button's window handle in the lParam,
then the CWnd's OnCommand handler, zeros the nCode
parameter, effectively making everything into a BN_CLICKED.
So I need to do:
GetParent()->SendMessage(WM_COMMAND,(WPARAM)(BN_PUSHED<<16|nID),hBtn);
Should I have known that?
(i.e. what purpose does that zeroing serve in OnCommand?)
|
|
|
|
|
Hi!
I have 3 Apps in my project. I would like to create a dialog with 3 buttons so that if I click on the first button the first app is launched. If I click on the second button, the second app is launched...
How can I do this?
thanks for helping..
Regards
Everything's beautiful if you look at it long enough...
|
|
|
|
|
1. find the path to each of your EXEs
2. use CreateProcess, spawn or WinExec to launch them
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
You Again!!
Well it seems that you are always there to answer my questions...;)
Thanks!!
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Hiya how do I check the contents of the recv function in window sockets??
I want to check the contents of the string, char by char.
This is my code so far:
int ret;
CString text;
for( int nReceivedBytes = 0;nReceivedBytes < 255; )
{
ret = recv( sock_Accept,text,255, 0 );
if( ret > 0 )
{
nReceivedBytes += ret;
}
}
Thanks,
grahamoj.
|
|
|
|
|
What do you mean check the contents of the string? Given that your code stores the incoming data into variable text, one solution is to check the CString object via [] operator.
Kuphryn
|
|
|
|
|
Hey all,
I want to get a list of exported DLL functions from a DLL (like Dependency Walker does) - along with each function's entry point.
How do I do that?
Thanks!
|
|
|
|
|
I may be wrong, but isn't the code for the Dependency Walker part of the examples shipped with Visual Studio?
Regards,
Alvaro
There are no stupid questions, but there are a lot of inquisitive idiots. -- despair.com
|
|
|
|
|
As far as I know - no...
I also looked for it on MSDN and couldn't find it.
Any other ideas? :-/
|
|
|
|
|
find some articles about the PE file format(it's the file format of exe and dll ... files).
i found a very nice tutorial at http://spiff.tripnet.se/~iczelion/tutorials.html
have a look at these tutorials, then u just have to code
have fun
|
|
|
|
|
Hey all,
I want to get a list of exported DLL functions from a DLL (like Dependency Walker does) - along with each function's entry point.
How do I do that?
Thanks!
|
|
|
|
|
Hello there
I would like to be able to open files from the left frames (I use Windows Explorer's TreeView style and a RichEditView app)
How could people open files from the tree when they double-click it?
Or how could I create a permanent (not included in each new window) tree control that could be used to open files faster?
|
|
|
|
|
Your question has more to do with design than technique. One solution is add a double mouseclick handler for the tree control. Open the file if applicable.
Kuphryn
|
|
|
|