1

I am using NI LabWindows CVI 8.1 to compile and build a executable program which I need to run on either Windows XP and Windows 2000 OS. I use Windows XP to compile and build the executable. The info I have so far is that I need to place some statement as follows:

#ifdef (windows xp)
//then specify path as C:\WINDOWS\system32
#elif (windows NT)
//then specify path as C:\WINNT\system32
#endif

I need to know what is the exact syntax and where to place it (like which header or source file to place it).

gary
  • 4,227
  • 3
  • 31
  • 58
dm.
  • 11
  • 1
  • XP can have a system path of C:\winnt (default case for upgrades from Win2k I think.) And C: might not be the system drive. And a crazy user could probably redirect Windows to somewhere else. – Michael Dec 07 '09 at 20:16

1 Answers1

3

Here's how to call APIs:

http://zone.ni.com/reference/en-XX/help/371361F-01/lvexcodeconcepts/ex_3_call_the_win32_api/

Then, try GetSystemDirectory:

http://msdn.microsoft.com/en-us/library/ms724373(VS.85).aspx

Stu
  • 15,675
  • 4
  • 43
  • 74
  • 2
    Indeed—do not hard code `C:` anything! I don't have a single system with the default directory. For example, the most used system has the system directory `E:\WINNT55SP2\SYS32`. – wallyk Dec 07 '09 at 20:03