Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionTo find biggest of n numbers ? Pin
Tarun Jha13-Oct-17 5:44
Tarun Jha13-Oct-17 5:44 
AnswerRe: To find biggest of n numbers ? Pin
jschell13-Oct-17 5:56
jschell13-Oct-17 5:56 
GeneralRe: To find biggest of n numbers ? Pin
Tarun Jha13-Oct-17 6:02
Tarun Jha13-Oct-17 6:02 
GeneralRe: To find biggest of n numbers ? Pin
jschell15-Oct-17 7:11
jschell15-Oct-17 7:11 
AnswerRe: To find biggest of n numbers ? Pin
Richard MacCutchan13-Oct-17 6:16
mveRichard MacCutchan13-Oct-17 6:16 
GeneralRe: To find biggest of n numbers ? Pin
Tarun Jha13-Oct-17 6:22
Tarun Jha13-Oct-17 6:22 
GeneralRe: To find biggest of n numbers ? Pin
jeron113-Oct-17 6:34
jeron113-Oct-17 6:34 
GeneralRe: To find biggest of n numbers ? Pin
Richard MacCutchan13-Oct-17 6:51
mveRichard MacCutchan13-Oct-17 6:51 
GeneralRe: To find biggest of n numbers ? Pin
Tarun Jha13-Oct-17 7:14
Tarun Jha13-Oct-17 7:14 
GeneralRe: To find biggest of n numbers ? Pin
David Crow13-Oct-17 16:10
David Crow13-Oct-17 16:10 
GeneralRe: To find biggest of n numbers ? Pin
Richard MacCutchan13-Oct-17 22:33
mveRichard MacCutchan13-Oct-17 22:33 
AnswerRe: To find biggest of n numbers ? Pin
leon de boer13-Oct-17 6:50
leon de boer13-Oct-17 6:50 
Questionwhile error ? Pin
bluatigro12-Oct-17 0:23
bluatigro12-Oct-17 0:23 
QuestionRe: while error ? Pin
David Crow12-Oct-17 2:35
David Crow12-Oct-17 2:35 
AnswerRe: while error ? Pin
Manish K. Agarwal12-Oct-17 4:22
Manish K. Agarwal12-Oct-17 4:22 
AnswerRe: while error ? Pin
Manish K. Agarwal12-Oct-17 4:26
Manish K. Agarwal12-Oct-17 4:26 
QuestionWhere is GetTickCount64()? Pin
inlandchris11-Oct-17 11:10
inlandchris11-Oct-17 11:10 
AnswerRe: Where is GetTickCount64()? Pin
Randor 11-Oct-17 11:52
professional Randor 11-Oct-17 11:52 
GeneralRe: Where is GetTickCount64()? Pin
inlandchris11-Oct-17 17:24
inlandchris11-Oct-17 17:24 
GeneralRe: Where is GetTickCount64()? Pin
Randor 11-Oct-17 19:26
professional Randor 11-Oct-17 19:26 
AnswerRe: Where is GetTickCount64()? Pin
leon de boer11-Oct-17 15:29
leon de boer11-Oct-17 15:29 
GeneralRe: Where is GetTickCount64()? Pin
inlandchris11-Oct-17 17:27
inlandchris11-Oct-17 17:27 
GeneralRe: Where is GetTickCount64()? Pin
Richard MacCutchan11-Oct-17 21:23
mveRichard MacCutchan11-Oct-17 21:23 
AnswerRe: Where is GetTickCount64()? Pin
inlandchris12-Oct-17 2:09
inlandchris12-Oct-17 2:09 
GeneralRe: Where is GetTickCount64()? Pin
leon de boer11-Oct-17 22:14
leon de boer11-Oct-17 22:14 
I am on VS2017 and the only code required is

C++
#define _WIN32_WINNT 0x0600
#include <WinBase.h>
void test(void) 
{
	long long i = GetTickCount64();
}

You also have me slight bemused you keep talking about finding the code, which is impossible it is buried in the kernel32.dll all you will find is the header file.

Here let me dynamically link it for you .. that is where the code is end of story. If it doesn't work your O/S is earlier than Vista.
#include "tchar.h"				// Unicode support
typedef long long (*tickproc64) (void);
tickproc64 myTick;

long long test(void) 
{
	long long i = 0;
	BOOL freeResult, runTimeLinkSuccess = FALSE;
	HMODULE dllHandle = NULL;

	//Load the dll and keep the handle to it
	dllHandle = LoadLibrary(_T("C:\\Windows\\System32\\kernel32.dll"));

	// If the handle is valid, try to get the function address. 
	if (NULL != dllHandle)
	{
		//Get pointer to our function using GetProcAddress:
		myTick = (tickproc64)GetProcAddress(dllHandle,	"GetTickCount64");  // Name must be ascii

		// If the function address is valid, call the function. 
		if (runTimeLinkSuccess = (NULL != myTick))
		{
			i = myTick();
		}

		//Free the library:
		freeResult = FreeLibrary(dllHandle);
	}

	return (i);
}

In vino veritas


modified 12-Oct-17 4:49am.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.