Thanks, Greg.
Yes, I've been "flattening" a cluster to pass it to the function. Sorry for not using this bit of LV nomenclature earlier. My wording must have made things confusing. Let's continue getting the record straight. (Sorry David and Rolf, perhaps this will clarify things for you guys)...
The developer who wrote the dll I'm calling was thinking ahead. He realized that most developers using his code wouldn't be using Delphi. So whenever he has Delphi-specific, user-defined data types, he has you pass them to the dll calls as pointers rather than as the actual data type. So once in a while I have to create a pointer to a user-defined Delphi "record" type that contains some mixture of other types - strings, longs, doubles, booleans, you name it.
I agree, Greg, that I should simply be able to use "adapt to type." Internally, you'd expect adapt to type to do the exact same thing that I'm doing byte by byte on my own. But, I swear to you that it doesn't work. It seems to me either LV or Delphi is dropping the ball. (My money's on Delphi. I wish NI could buy Borland and turn their headquarters into a warehouse! I loathe that company - but that's beside the point.) And I know this, because if I use adapt to type, I have to switch the booleans in my cluster to I32's. But even then everything's still wrong - the bytes of all numeric values have been reversed! I get these huge numbers going into the function, and the booleans always come out FALSE because the "true" byte is at the wrong end. Strings, on the other hand, come out just fine!
To circumvent this crap, I pass the whole thing as an array data pointer ([U8]), which I build piece-wise as described in my earlier post. How do I know to do this? A whole lot of trial and error.
So my original question was this: Why do I have to so painstakingly fiddle with my data? As you point out, everything on the stack gets promoted to 4 bytes. The answer to my question probably has something to do with that fact. But you would think that the software would take care of this kind of stuff along the way, so we humans don't have to think in 1's and 0's.
My approach to solving this problem is unconventional, a royal pain, and certainly not for everyone - I'll give you that. But for anyone reading this in the future because they're stuck debugging a Call Library Function node that takes some freaky data type - particularly if the DLL was written in Delphi - I will say that you may have to get down and dirty with your bytes.
"You keep using that word. I do not think it means what you think it means." - Inigo Montoya