Yaoming wrote:
> SVences,<br><br>I know that Erroneous data types assignments can cause crashes.
> I have checked all the data type with my experience and knowledge,but I didn't
> find anything should cause this crash problem.<br><br>After all,I am not very
> experienced in Call Library Function, so maybe my vi still have some erroneous
> data type assignments. Can any DLL expert help me to locate them?
> For the original function description, I have posted as attachment in the first
> post. Therefore,anybody who want to check my data type error can have a check
> with that function description.
> That issue is very urgent and important to me. Can anybody to help me sort
> this problem as soon as possible? Thanks in advance.
A few remarks:
1) the Bool return value is probably an int. It doesn't look like a
standard Widnows datatype so you will have to look in the documentation.
However this is unlikely to crash your code.
2) The handle parameter for DWD_set_comport should be set as Pass:
Pointer to Value. All other parameters should be passed by Value only as
they are not pointers at all. Also please wire a 0 constant to the right
side of the CLN for that parameter to provide memory for the DLL to
write in.
3) The calling convention for the DLL functions is not obvious from your
documentation. You have the choice between C (cdecl) and WINAPI
(stdcall) on Windows. Since this DLL seems to be available for multiple
platforms (The remark for each function) it may be that the developer
decided to use cdecl calling convention (a smart choice I would say) but
Windows DLLs usually use stdcall instead.
Having the wrong one will absolutely crash LabVIEW but usually at the
moment you return from the functioncall and not later on.
So I would guess the most probable cause is number 2, but don't discount
the other ones completely.
Rolf Kalbermatter