キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

CreateEvent() returns 0

解決済み
解決策を見る
Looks like all this moving a discussion from one topic to another only made it more messy...
In that second topic:
@Thoric wrote:

 

In your Call Library Function Node (CLFN), go to the Error Checking tab and select Maximum. This will cause LV to take extra precautions when calling the dll and might help prevent the crash, allowing you to experiment with different calling parameters etc.

 

The WaitForSingleObject function does not take a floating point input at the second parameter. Your coercion dot shows that you're asking LabVIEW to coerce a positive infinity to an integer, which isn't going to work. Read the MSDN help on this call to learn that the timeout is in milliseconds, and "infinite" is a special case of 0xFFFFFFF. Use the maximum an unsigned 32-bit value can hold, which is 4294967295. This is the special infinite case.


Maximum error checking didn't help and the code still crushes without any information.

Also using the maximum U32 value didn't solve the problem. 

What's more I've just noticed, that calling WaitForSingleObject function causes a plugged camera hang up. 

0 件の賞賛
メッセージ11/17
2,826件の閲覧回数

@turbolek wrote:
Looks like all this moving a discussion from one topic to another only made it more messy...
In that second topic:
@Thoric wrote:

 

In your Call Library Function Node (CLFN), go to the Error Checking tab and select Maximum. This will cause LV to take extra precautions when calling the dll and might help prevent the crash, allowing you to experiment with different calling parameters etc.

 

The WaitForSingleObject function does not take a floating point input at the second parameter. Your coercion dot shows that you're asking LabVIEW to coerce a positive infinity to an integer, which isn't going to work. Read the MSDN help on this call to learn that the timeout is in milliseconds, and "infinite" is a special case of 0xFFFFFFF. Use the maximum an unsigned 32-bit value can hold, which is 4294967295. This is the special infinite case.


Maximum error checking didn't help and the code still crushes without any information.

Also using the maximum U32 value didn't solve the problem. 

What's more I've just noticed, that calling WaitForSingleObject function causes a plugged camera hang up. 


No, it's only messy because you started replying in both threads, contrary to the advice given.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 件の賞賛
メッセージ12/17
2,814件の閲覧回数

Can you see any reply I've posted in that topic? No? Right because I didn't. Can we please leave that issue alone and focus on LabVIEW instead?

I am attaching a piece of code to illustrate the problem.

0 件の賞賛
メッセージ13/17
2,795件の閲覧回数
解決策
トピック作成者turbolekが受理

OK, I've gound a solution finally. It was all about changing Calling Convention of WaitForSingleObject function from C to stdcall(WINAPI). Seems obvious, but I must have missed it :]

Thanks for your help, everybody.

0 件の賞賛
メッセージ14/17
2,782件の閲覧回数

@turbolek wrote:

Can you see any reply I've posted in that topic? No? Right because I didn't. Can we please leave that issue alone and focus on LabVIEW instead?

I am attaching a piece of code to illustrate the problem.


I can see why you were upset.  I had forgotten that I had already posted about that.  My apologies.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 件の賞賛
メッセージ15/17
2,769件の閲覧回数

@turbolek wrote:

OK, I've gound a solution finally. It was all about changing Calling Convention of WaitForSingleObject function from C to stdcall(WINAPI). Seems obvious, but I must have missed it :]

Thanks for your help, everybody.


You're welcome. Glad you worked it out. Those options are easily missed! スマイリー とてもハッピー

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 件の賞賛
メッセージ16/17
2,762件の閲覧回数

I came across a similar issue, thank you for your code. I changed it to make it work on LabVIEW 2017 SP1 + Windows 10, see attached VI. I also improved the UI a bit.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 件の賞賛
メッセージ17/17
2,593件の閲覧回数