Aaron
Aaron

Reputation: 4480

Using GetCpInfo

I am trying to write a small program to run GetCpInfo, but am getting an identifier not found error . I am including windows.h and using visual studio. IntelliSense is autocomplete for me when I type in GetCp. Here is my code.

#include <iostream>
#include <windows.h>

using namespace std;




int main()
{
    LPCPINFO cpinfo;
    cout << "Hello World!" << endl;
    bool test = GetCpInfo(37, cpinfo);
    int x;
    cin>>x;

    return 0;
}

Upvotes: 0

Views: 662

Answers (1)

David Heffernan
David Heffernan

Reputation: 613612

Two problems:

  1. The function is named GetCPInfo. Remember that the language is case sensitive.
  2. You are passing an uninitialized pointer.

You need the following:

CPINFO cpinfo;
bool succeeded = GetCPInfo(37, &cpinfo);

Upvotes: 1

Related Questions