このコードをコンパイルしようとすると、「GetClickCount 識別子が見つかりません」というエラーが表示される理由がわかりません。(GetClickCount64 でも同じエラーが発生します)。誰かが説明できることを願っていました。問題に関する私の検索のほとんどは、コードに #include が欠けていることを示しているようですが、それは明らかに私の問題ではありません。
#include <Windows.h>
#include "stdafx.h"
#include "InSort.h"
#include "DataSet.h"
using namespace std;
using namespace System;
ref class Test
{
public:
Test(){}
// TestInsertSortProcedure() method tests the InsertSort process for the duration
// of the sorting proceedure by checking the time prior to and after the SortCollection()
// method has run on five different lengths of the array being sorted, each subsequent length
// being 10-fold greater than the previous length
void TestInsertSortProcedure()
{
int start;
int finish;
int total;
unsigned int increment;
InSort<int>^ myInsertSorter = gcnew InSort<int>();
for (increment = 1; increment < 1000000; increment = increment * 10)
{
// get new dataset with new number of elements equal to increment value
Dataset^ myDataArray = gcnew Dataset(increment);
// Timestamp prior to sorting:
start = GetTickCount();
// Sort collection
myInsertSorter->SortCollection(myDataArray->unsortedArray);
// Timestamp at completion of sorting
finish = GetTickCount();
total = finish - start;
// Print result to console
Console::WriteLine(L"Sorting time in milliseconds was: " + total);
}
}
};
int main(array<System::String ^> ^args)
{
Test^ testing = gcnew Test();
testing->TestInsertSortProcedure();
return 0;
}