changing header C++ 6.0


hi everyone

can i use header VC++ 2008,2010,2013 with C++ 6.0 ?
If you do refer to the MSVC 6.0 that was released 1998, then it is highly unlikely that it does accept new headers. Overall, a compiler and C++ standard library are quite strongly coupled, so mixing is hardly ever a good idea.
thank you keskivertoo

i mean some API isn't declared in MSVC 6.0
like: GetConsoleWindow(); in Header Wincon.h

i read this out forum;
{
declare function HWND WINAPI GetConsoleWindow(void);


in wincon.h header for vc++ 6.0

now can GetConsoleWindow
}
____________________________________

//i’am so sorry for my poor English.

thanks keskiverto
Last edited on
You can use LoadLibrary and GetProcAddress to dynamically call the function.
Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
HWND MyGetConsoleWindow()
{
	typedef HWND (WINAPI* fnGetConsoleWindow)();
	
	HMODULE hDll = LoadLibrary("Kernel32.dll");
	if (hDll == NULL)
	{
		// error: see GetLastError()
		return NULL;
	}

	HWND res = NULL;
	fnGetConsoleWindow fn = (fnGetConsoleWindow)(GetProcAddress(hDll, "GetConsoleWindow"));
	if (fn != NULL)
	{
		res = fn();
	}
	else
	{
		// error: see GetLastError()
	}

	FreeLibrary(hDll);

	return res;
}

is clear and new method for me
i can understand this.


Return thank you fcantoro ;
Topic archived. No new replies allowed.