2013-12-22 68 views
-1

在C#我有這樣的P/Invoke聲明:如何從C++調用WinApi函數?

[DllImport("ntdll.dll", SetLastError = true)] 
    public static extern int NtQueryTimerResolution(out int MinimumResolution, out int MaximumResolution, out int ActualResolution); 

我可以按名稱,然後使用功能:NtQueryTimerResolution(out min, out max, out current);

我重寫我的代碼C++。如何在C++中進行相同的導入?

+0

它的無證,所以它是不可靠的,而不是在任何分佈式頭,所以你不得不求助於葉奧爾德'LoadLibrary'和' GetProcAddress'。 – chris

+0

我想我只是找到了我在找的東西https://code.google.com/p/bitspersampleconv2/source/browse/trunk/TimerTest2/main.cpp?r=2813 – javapowered

回答