ACS Posted March 12, 2009 Report Share Posted March 12, 2009 Greetings, all, I need to call a DLL in the Windows API. The DLL returns a pointer to an array; the array is a list of process identifiers (strings, I presume). What do I need to do with that pointer to get an array of strings? Thanks! Quote Link to comment
vugie Posted March 13, 2009 Report Share Posted March 13, 2009 You have to use MoveBlock. You also have to know the total size of this array. Just create Call Library Function node, put "LabVIEW" as library name and find MoveBlock function. Define arguments as usual. As pointer to destination use U8 Array of exactly same size (wire an initialized array to that input). Then you have to cut resulting array to pieces searching for zeros and convert these pieces to strings. Quote Link to comment
Rolf Kalbermatter Posted March 19, 2009 Report Share Posted March 19, 2009 QUOTE (ACS @ Mar 11 2009, 03:38 PM) Greetings, all,I need to call a DLL in the Windows API. The DLL returns a pointer to an array; the array is a list of process identifiers (strings, I presume). What do I need to do with that pointer to get an array of strings? Thanks! When you say it returns an array pointer do you mean returning it as function return value? That would be a very ugly way for an API to return such a parameter!! And if those process identifiers are really strings that parameter is anyhow not for direct LabVIEW consumption, really! However I would assume that they contain instead 32Bit integers for all practical OSes nowadays (possibly excluding 64 Bit versions). At least under Windows and Unix, OS Process Identifiers (or PIDs) are simply 32Bit numbers that can be passed to other APIs to identify a specific process. But since it is an array you will first need to know how big it is anyhow, before you can do anything. Can you give us the function protoytpe so we can see how it looks and what direction we will have to look for? Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.