02-01-2010 11:23 AM - edited 02-01-2010 11:29 AM
Hi,
I'll trying to call GetVersionEX Function from kernel32.dll. (trying to determien OS version)
One of the parameters is OSVERSIONINFOEX with the following definition:
typedef struct _OSVERSIONINFOEX {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
TCHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} OSVERSIONINFOEX, *POSVERSIONINFOEX, *LPOSVERSIONINFOEX;
I am using the Call Library Function Node in Labview with a parameter defined as Type-> Adapt to Type, and Data Format->Handles by Value. (please correct me if this is incorrect).
I'm trying to define the OSVERSIONINFOEX structure as a cluster but I'm having trouble on how to define the fixed array szCSDVersion[128] so that it is not a pointer. I've tried it as a byte array initialied to 128 elements and string with 128 dummy chars but both end up being pointers.
Attached is my cluster (which doesn't work).
Any help would be greatly appreciated in defining this cluster and ultimately calling the dll function to get the OS version info.
Thanks,
James
Solved! Go to Solution.
02-01-2010 11:30 AM
I can't think of a way other than passing szCSDVersion as a pointer.
I am curious at what others may propose as an alternative.
02-01-2010 01:16 PM
btw. If there is a better way to call the "GetVersionEX" without using a cluster or using another method, please let em know. As I said, the main purpose is to be able to read the OS version information so I can perform unique tasks during the installation of my application based on the OS and service pack info.
Thanks,
James
02-01-2010 02:54 PM
02-01-2010 03:28 PM
Thanks!! That did it.
Here's a simple copy of what I'm using for anyone interested.
Thanks,
James
06-30-2011 07:31 AM
Hi
I am facing the same problem as explained in this thread.
I could not understood this below solution.
"The easiest way to do this is to wire an empty cluster of U8 to array to cluster, set the cluster size to 128, and create a constant or control. "
Can anyone explain in detail what is the solution for these kind of problems?
06-30-2011 07:37 AM
Hi
I am facing the same problem.
I have labview 7.1 version.I don't have labview 9.0 version hence i am not able to open the solution example attached here.
Please provide me the solution vi which can be opened with labview 7.1 version.
06-30-2011 02:10 PM
@22445466 wrote:
I could not understood this below solution."The easiest way to do this is to wire an empty cluster of U8 to array to cluster, set the cluster size to 128, and create a constant or control. "
Can anyone explain in detail what is the solution for these kind of problems?
Sorry, I made an error in that sentence. It should say "wire an empty array of U8..." "Array to Cluster" is a built-in LabVIEW function.
I don't have a version of LabVIEW old enough to save the posted code back to 7.1, but you could try asking in the Downconvert VI Requests thread.
07-01-2011 01:58 AM
Yeah i assumed that its empty array of U8 and i tried like that.
I have wired empty array of U8 to "array to cluster" and created a indicator which is cluster and i have set cluster
size to 6 since i need array of 6 elements.
But after that how to put this data in the actual cluster with existing parameters.
But is it possible to drag and drop one cluster into another?I tried drag and drop it does not work.
Could anybody tell me options to pass data to the cluster from cluster?
07-01-2011 08:27 AM
@22445466 wrote:
Yeah i assumed that its empty array of U8 and i tried like that.
I have wired empty array of U8 to "array to cluster" and created a indicator which is cluster and i have set cluster
size to 6 since i need array of 6 elements.
But after that how to put this data in the actual cluster with existing parameters.
But is it possible to drag and drop one cluster into another?I tried drag and drop it does not work.
Could anybody tell me options to pass data to the cluster from cluster?
There is no problem embedding one cluster inside another cluster, and you should be able to drag one cluster into another. Can you be more specific than "does not work"? If the target cluster is a type definition then you will not be able to add items to it on the front panel, because it is locked to the type definition - is this your problem? If so, you need to modify the type definition.