This widget could not be displayed.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

winapi memory allocation/pointer for SendMessage GetItemText

Solved!
Go to solution

I'm using the WinAPI to read a listbox from an non-LabView application. For the get item text message I need to supply a pointer to available memory to place the returned string.

 

 

If the factor is to low then LabView Crashes. Typically 200 string characters (100 unicode). Not enough memory, memory overrun, crash (ntdll.dll error). If on the other hand I increase it to much (2 * 1024 = 2048) LabView crashes as well.

 

What the hell is going on here? My labview app needs to run unattended for days reading hundreds of thousands of text lines and until I understand what's happening I'm just rolling dice. The listbox can have hundreds of lines of text but I only allocate the memory once and reuse it in a for loop containing the Send Msg.

 

TIA  Norm.

0 Kudos
Message 1 of 6
(3,674 Views)

Can you share your code (the VIs, not just a screenshot)? Are you calling WinAPI functions through Call Library Function Node? If so, try changing the error checking level to maximum, and see if that gets you a more helpful error message instead of a crash. While it won't fix the problem, it might lead to a solution.

0 Kudos
Message 2 of 6
(3,659 Views)

I'm using the G toolkit by George Zou. I don't have the source for the send msg vi but I am asuming he uses CINs using user32.dll. If I'm lucky he will pop in on this thread.

0 Kudos
Message 3 of 6
(3,647 Views)

 

0 Kudos
Message 4 of 6
(3,525 Views)
Solution
Accepted by topic author Viper

George Zou was kind enough to build this example for his toolkit.

 

Untitled.png

0 Kudos
Message 5 of 6
(3,522 Views)

Hi Viper,

 

Can you share with me ? Now I am just try to achieve it?your example is that i need.Could you shard the example ?

 

thank you.

0 Kudos
Message 6 of 6
(2,161 Views)