
Signature
MVP VC++ FAQ: http://www.mvps.org/vcfaq
> >I'm trying to use:
>>
[quoted text clipped - 18 lines]
> (say 2 separate push buttons on a form), and see if that makes any
> difference.
Well, one of the problems was that I didn't leave enough time between the
keystroke and the clipboard query, but there were other issues as well. For
some reason, using the code during a BackgroundWorker::DoWork failed, but
using it during a Form::Load worked. Another problem was that as I ran the
code in a loop a nullptr would come up if I switched the active window as it
was taking the shots. So the code was working like I wanted, but when I
alt-tabbed from an app window to VS, it'd give me a NullReferenceException,
and I'd grumble thinking it happened on the first pass. The problem worked
the other way too (i.e. from VS/system tray looping ss'ing app to
full-screen game), and the exception actually would occur on the first pass
and confuse me even more. It took me a long time to get my program working
though everything feels rather fragile, and I still don't get why things are
the way they are.
Atul - 06 Sep 2005 03:07 GMT
>For some reason, using the code during a BackgroundWorker::DoWork failed,
>but using it during a Form::Load worked.
I think this can be cured by calling Application.OleRequired for the
background thread.
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
>> >I'm trying to use:
>>>
[quoted text clipped - 33 lines]
> to get my program working though everything feels rather fragile, and I
> still don't get why things are the way they are.
James Park - 06 Sep 2005 22:55 GMT
> >For some reason, using the code during a BackgroundWorker::DoWork failed,
> >but using it during a Form::Load worked.
>
> I think this can be cured by calling Application.OleRequired for the
> background thread.
Thanks for the suggestion. Unfortunately, it didn't work.