Click here to Skip to main content
15,912,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GetUserName() API failing condition Pin
ktm TechMan16-Sep-08 22:27
ktm TechMan16-Sep-08 22:27 
GeneralRe: GetUserName() API failing condition Pin
Rajesh R Subramanian16-Sep-08 22:56
professionalRajesh R Subramanian16-Sep-08 22:56 
JokeRe: GetUserName() API failing condition Pin
TheRealEye17-Sep-08 0:58
TheRealEye17-Sep-08 0:58 
AnswerRe: GetUserName() API failing condition Pin
Hamid_RT17-Sep-08 8:20
Hamid_RT17-Sep-08 8:20 
Questionhello i want to redirecting functions using pointers only and i get 2 errors Pin
nah133716-Sep-08 18:53
nah133716-Sep-08 18:53 
AnswerRe: hello i want to redirecting functions using pointers only and i get 2 errors Pin
Cedric Moonen16-Sep-08 19:57
Cedric Moonen16-Sep-08 19:57 
AnswerRe: hello i want to redirecting functions using pointers only and i get 2 errors Pin
enhzflep16-Sep-08 20:12
enhzflep16-Sep-08 20:12 
GeneralRe: hello i want to redirecting functions using pointers only and i get 2 errors Pin
nah133716-Sep-08 20:55
nah133716-Sep-08 20:55 
Thnx for very good post but still i got 1 error
main.cpp
C:\Documents and Settings\ivor\Desktop\project\main.cpp(35) : error C2275: 'GLDRAWELEMENTS_TYPE' : illegal use of this type as an expression
C:\Documents and Settings\ivor\Desktop\project\main.cpp(27) : see declaration of 'GLDRAWELEMENTS_TYPE'
it should be this i dunno why the code block ignores it
includes should be stdio.h detours.h vector tlhelp32.h mmsystem.h process.h math.h


#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>


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






#define Client_GLDRAWELEMENTS    0x4E5DA2

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


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

GLDRAWELEMENTS_TYPE *CAST;
    CAST( GLDRAWELEMENTS_TYPE, g_dwGlDrawElements )( iMode, iCount, iType, pvIndices );
}  



// Redirect





bool WINAPI DllMain(HINSTANCE hDll, DWORD dwReason, PVOID pvReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH)
	{
g_dwGlDrawElements = *( DWORD * )Client_GLDRAWELEMENTS;
		*( DWORD * )Client_GLDRAWELEMENTS = PtrToUlong( glDrawElementsHook ); 

		
		
		return true;
	}
	else if(dwReason == DLL_PROCESS_DETACH)
	{
	}
    return false;
}</vector></tlhelp32.h></mmsystem.h></process.h></math.h></detours.h></stdio.h></windows.h>

GeneralRe: hello i want to redirecting functions using pointers only and i get 2 errors Pin
enhzflep16-Sep-08 21:15
enhzflep16-Sep-08 21:15 
GeneralRe: hello i want to redirecting functions using pointers only and i get 2 errors Pin
nah133717-Sep-08 10:49
nah133717-Sep-08 10:49 
GeneralRe: hello i want to redirecting functions using pointers only and i get 2 errors Pin
enhzflep17-Sep-08 16:31
enhzflep17-Sep-08 16:31 
GeneralRe: hello i want to redirecting functions using pointers only and i get 2 errors Pin
nah133717-Sep-08 23:47
nah133717-Sep-08 23:47 
GeneralRe: hello i want to redirecting functions using pointers only and i get 2 errors Pin
enhzflep18-Sep-08 19:19
enhzflep18-Sep-08 19:19 
GeneralRe: hello i want to redirecting functions using pointers only and i get 2 errors Pin
nah133718-Sep-08 23:39
nah133718-Sep-08 23:39 
QuestionThere is some limit for year in DateTimeCtrl ? Pin
Le@rner16-Sep-08 18:48
Le@rner16-Sep-08 18:48 
AnswerRe: There is some limit for year in DateTimeCtrl ? Pin
_AnsHUMAN_ 16-Sep-08 19:59
_AnsHUMAN_ 16-Sep-08 19:59 
GeneralRe: There is some limit for year in DateTimeCtrl ? Pin
Le@rner16-Sep-08 20:04
Le@rner16-Sep-08 20:04 
GeneralRe: There is some limit for year in DateTimeCtrl ? Pin
Chandrasekharan P16-Sep-08 20:24
Chandrasekharan P16-Sep-08 20:24 
QuestionMessage from a "Service" in vista Pin
Subrat Patnaik16-Sep-08 18:31
Subrat Patnaik16-Sep-08 18:31 
QuestionRe: Message from a "Service" in vista Pin
Mark Salsbery17-Sep-08 6:35
Mark Salsbery17-Sep-08 6:35 
QuestionCrystal report & XML - problem Pin
tammyluk16-Sep-08 17:24
tammyluk16-Sep-08 17:24 
QuestionKeeping my application on top Pin
frqftgbdafr16-Sep-08 12:07
frqftgbdafr16-Sep-08 12:07 
AnswerRe: Keeping my application on top Pin
followait16-Sep-08 19:55
followait16-Sep-08 19:55 
GeneralRe: Keeping my application on top Pin
frqftgbdafr17-Sep-08 5:46
frqftgbdafr17-Sep-08 5:46 
GeneralRe: Keeping my application on top Pin
followait17-Sep-08 15:25
followait17-Sep-08 15:25 

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.