"Bruce Bowler" <[EMAIL PROTECTED]> wrote:

>First, I'm running a hopelessly ancient version (5.0.1) of LabView.  As
>soon as I can get the boss to spring for it I'll upgrade but until then,
>I'm stuck...

Ogh, 5.0.1 wasn't the most stable one. 5.1.1 was in my experience quite
better. Also be aware that while upgrading applications from one version
to the next is usually a quite easy step, upgrading from 5.0 to 7.1 will
have some good chances of rough bumps on the road.

>What I've tried so far, is to create a byte array that's 46 bytes long (as
>near as I can tell, that's the size of the structure.)  Converted that to
>a string, passed the string to the "call library" function and wired the
>output to a string indicator.  When I run it, I either get an error
>complaining about gnrclist.c, line 192 or the dreaded "illegal operation".

46 bytes is definitely not enough!!!!!! Just look at this:

typedef struct _TIME_ZONE_INFORMATION {
4 bytes        LONG Bias;
32 * 2 bytes   WCHAR StandardName[32];
8 * 2 bytes    SYSTEMTIME StandardDate;
4 bytes        LONG StandardBias;
32 * 2 bytes   WCHAR DaylightName[32];
8 * 2 bytes    SYSTEMTIME DaylightDate;
4 bytes        LONG DaylightBias;
} TIME_ZONE_INFORMATION, 

Adding this together I come up with 172 bytes so now wonder LabVIEW is taken
down by Windows when you pass in 46 bytes.
Also I'm not sure if LabVIEW does this already in 5.x but later on if you pass
in a sting in a CLN LabVIEW cuts it down at the first NULL byte in it on return.
So for structures it is better to pass an array of U8 to a library function if
you need to access some information inside that structure after the function
returns.

Rolf Kalbermatter
CIT Engineering Nederland BV    tel: +31 (070) 415 9190
Treubstraat 7H                  fax: +31 (070) 415 9191
2288 EG Rijswijk        http://www.citengineering.com
Netherlands             mailto:[EMAIL PROTECTED]
 



Reply via email to