Newbee Visual C++ Question -- GetWindowsDirectory()

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi!

I've fired up my first Visual C++ .NET (Version 7) project and have made
some nice progress. However, I'm now trying to call the familiar
GetWindowsDirectory() API.

When I'm laying in the code, the editor recognizes the function (it is
prompting me for the proper parameters) but when I compile I get "Error
3861: 'GetWindowsDirectory' : identifier not found, even with argument
dependent lookup".

I'm making the call just after InitializeComponent() in my initial form:

GetWindowsDirectory(WindowsDirectory,sizeof(WindowsDirectory));

I've defined the receiving buffer as a char array (perhaps this is one
problem):

char WindowsDirectory[_MAX_PATH]="";

and I've tried locating this declaration at various places through the my
form1.h file.

Removing the API call results in a successful compilation and link.

Can someone see what I'm doing wrong? It could be a real bone-head
mistake -- I'm new to this development environment.

TIA

Harry



.



Relevant Pages

  • Re: Determining System Directories ??
    ... I don't know of such in VB, but I do know of an API call that works for it! ... Declare Function GetWindowsDirectory Lib "kernel32" Alias ... Dim gwdRet As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: Newbee Visual C++ Question -- GetWindowsDirectory()
    ... > GetWindowsDirectory() API. ... > When I'm laying in the code, the editor recognizes the function (it is ...
    (microsoft.public.dotnet.languages.vc)
  • Re: GetSystemWindowsDirectory without using GetProcAddress
    ... GetWindowsDirectory()), but your app will not work properly on NT4.0 OS. ... define the WINVER to 0x0500 in order to use GetSystemWindowsDirectory() API. ... > I got it to work using GetProcAddress as in KB281316 ...
    (microsoft.public.vc.language)