LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling ClipboardPutBitmap() in multiple threads

Hi,

 

I'm seeing an issue where the ClipboardPutBitmap() is slow when being called from a thread function except the first time it is called.  By slow, I'm talking about 5 seconds for the call to complete, whereas it normally takes about 10 ms.  If I call it from the main thread it is fast every time.  I see this behavior whether I'm running the release executable or a debuggable.  Any ideas?  It looks to me like something is timing out with a time out value of five seconds.  It should be noted that the function does complete with no errors and the bitmap does get put on the clipboard after the function returns.

 

I've attached a small console project that shows the issue I'm having.

 

I'm using CVI 2010 SP1 on Windows 7 Professional x64.

 

Thanks. 

 

0 Kudos
Message 1 of 3
(2,968 Views)

I've been able to run this and I'm seeing the same behavior that you are.  I'll investigate the issue furthter to see why this might be happening.

 

Jon S

Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,951 Views)

Hi.  Thanks for looking into this.  Right now I'm using PostDeferredCallToThread() so that my calls to ClipboardPutBitmap() run in the main thread.  This works but isn't always ideal.  Is there any better workarounds?  Thanks.

0 Kudos
Message 3 of 3
(2,932 Views)