Click here to Skip to main content
15,899,025 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Function calling in header file Pin
Cedric Moonen7-Oct-08 20:15
Cedric Moonen7-Oct-08 20:15 
AnswerRe: Function calling in header file Pin
CPallini7-Oct-08 23:06
mveCPallini7-Oct-08 23:06 
AnswerRe: Function calling in header file Pin
Bram van Kampen8-Oct-08 9:03
Bram van Kampen8-Oct-08 9:03 
QuestionPrinter HW Serial Number Pin
Bram van Kampen7-Oct-08 15:04
Bram van Kampen7-Oct-08 15:04 
AnswerRe: Printer HW Serial Number Pin
Garth J Lancaster7-Oct-08 16:14
professionalGarth J Lancaster7-Oct-08 16:14 
AnswerRe: Printer HW Serial Number Pin
Mark Salsbery8-Oct-08 6:18
Mark Salsbery8-Oct-08 6:18 
AnswerRe: Printer HW Serial Number Pin
Mark Salsbery8-Oct-08 6:27
Mark Salsbery8-Oct-08 6:27 
QuestionI get compile error c2440 it tells me cannot convert from void please help Pin
nah13377-Oct-08 9:26
nah13377-Oct-08 9:26 
#include <windows.h>
#include <stdio.h>
#include <detours.h>
#include
#include
#include <math.h>
#include <process.h>
#include <mmsystem.h>
#include <tlhelp32.h>
#include <vector>
//icludes are they
windows.h ;stdio.h;detours.h;math.h;process.h;vector;mmsystem.h;tlhelp32.h




#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "winmm.lib")






#define Client_GLDRAWELEMENTS    0x4E5DA2

#define CAST( Type, Address )        ( ( Type )( Address ) )







typedef void ( WINAPI *GLDRAWELEMENTS_TYPE )( GLenum iMode, GLsizei iCount, GLenum iType, const GLvoid *pvIndices );

GLDRAWELEMENTS_TYPE g_dwGlDrawElements = NULL;

		


void WINAPI glDrawElementsHook( GLenum iMode, GLsizei iCount, GLenum iType, const GLvoid *pvIndices )
{
  
	
	
	( g_dwGlDrawElements )( iMode, iCount, iType, pvIndices );
}  



DWORD OpenGLHooks( PVOID pvArgs )
{
          do
        {
               g_dwGlDrawElements = *( DWORD * )Client_GLDRAWELEMENTS;

               Sleep( 100 );

        } while( g_dwGlDrawElements == NULL );

        *( DWORD * )Client_GLDRAWELEMENTS = PtrToUlong( glDrawElementsHook );

        return NULL;
}  

	
   


bool WINAPI DllMain(HINSTANCE hDll, DWORD dwReason, PVOID pvReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH)
	{

	
	
	
	CreateThread( NULL, 0, ( LPTHREAD_START_ROUTINE )OpenGLHooks, NULL, 0, NULL );
   

	
	return true;
	}
	else if(dwReason == DLL_PROCESS_DETACH)
	{
	}
    return false;
}

AnswerRe: I get compile error c2440 it tells me cannot convert from void please help Pin
Cedric Moonen7-Oct-08 20:16
Cedric Moonen7-Oct-08 20:16 
GeneralRe: I get compile error c2440 it tells me cannot convert from void please help Pin
nah13377-Oct-08 22:57
nah13377-Oct-08 22:57 
GeneralRe: I get compile error c2440 it tells me cannot convert from void please help Pin
nah13378-Oct-08 0:32
nah13378-Oct-08 0:32 
QuestionRe: I get compile error c2440 it tells me cannot convert from void please help Pin
David Crow8-Oct-08 4:03
David Crow8-Oct-08 4:03 
AnswerRe: I get compile error c2440 it tells me cannot convert from void please help Pin
nah13378-Oct-08 6:03
nah13378-Oct-08 6:03 
QuestionRe: I get compile error c2440 it tells me cannot convert from void please help Pin
David Crow8-Oct-08 6:08
David Crow8-Oct-08 6:08 
AnswerRe: I get compile error c2440 it tells me cannot convert from void please help Pin
nah13378-Oct-08 6:10
nah13378-Oct-08 6:10 
QuestionA function pointer. Pin
daavena7-Oct-08 8:44
daavena7-Oct-08 8:44 
AnswerRe: A function pointer. Pin
Maximilien7-Oct-08 8:52
Maximilien7-Oct-08 8:52 
GeneralRe: A function pointer. Pin
daavena7-Oct-08 9:06
daavena7-Oct-08 9:06 
GeneralRe: A function pointer. Pin
daavena7-Oct-08 10:14
daavena7-Oct-08 10:14 
AnswerRe: A function pointer. Pin
Roger Stoltz7-Oct-08 12:16
Roger Stoltz7-Oct-08 12:16 
GeneralRe: A function pointer. Pin
daavena10-Oct-08 1:55
daavena10-Oct-08 1:55 
GeneralRe: A function pointer. Pin
Michael Dunn7-Oct-08 19:43
sitebuilderMichael Dunn7-Oct-08 19:43 
QuestionCTreeCtrl - open at specific depth level Pin
john john mackey7-Oct-08 7:01
john john mackey7-Oct-08 7:01 
AnswerRe: CTreeCtrl - open at specific depth level Pin
led mike7-Oct-08 9:13
led mike7-Oct-08 9:13 
GeneralRe: CTreeCtrl - open at specific depth level Pin
john john mackey7-Oct-08 10:38
john john mackey7-Oct-08 10:38 

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.