Click here to Skip to main content
15,891,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Base Address Pin
Shouvik Das23-Jan-07 19:26
Shouvik Das23-Jan-07 19:26 
GeneralRe: Base Address Pin
Stephen Hewitt23-Jan-07 19:31
Stephen Hewitt23-Jan-07 19:31 
GeneralRe: Base Address Pin
Shouvik Das23-Jan-07 19:35
Shouvik Das23-Jan-07 19:35 
GeneralRe: Base Address Pin
Stephen Hewitt23-Jan-07 19:37
Stephen Hewitt23-Jan-07 19:37 
GeneralRe: Base Address Pin
Shouvik Das23-Jan-07 19:39
Shouvik Das23-Jan-07 19:39 
GeneralRe: Base Address Pin
Stephen Hewitt23-Jan-07 19:40
Stephen Hewitt23-Jan-07 19:40 
GeneralRe: Base Address Pin
Shouvik Das23-Jan-07 19:46
Shouvik Das23-Jan-07 19:46 
GeneralRe: Base Address Pin
Stephen Hewitt23-Jan-07 20:06
Stephen Hewitt23-Jan-07 20:06 
This is what you're trying to do but should not even consider:

// Win32.cpp : Defines the entry point for the application.
//
 
#include "stdafx.h"
#include <windows.h>
 
class CMyClass
{
private:
	void Private();
};
 
void CMyClass::Private()
{
	MessageBox(NULL, "CMyClass::Private", NULL, MB_OK);
}
 
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	// Type for a pointer to a member of "CMyClass" which returns and accepts nothing.
	typedef void (CMyClass::*PMyClassMemFun)();
 
	// Set the pointer from the address in the map file.
	PMyClassMemFun pFunc;
	*reinterpret_cast<ULONG_PTR*>(&pFunc) = 0x00401020; // From map file.
 
	// Instantiate the class and call the private function.
	CMyClass inst;
	(inst.*pFunc)();
 
	return 0;
}


Again I reiterate; this is perverse but that's code to do what you we're trying to do.

NOTE: You have to compile this code and then get the address from the map file. There is no guarantee your address is the same as mine. Any code changes and the address could change.


Steve

GeneralRe: Base Address Pin
Shouvik Das23-Jan-07 20:19
Shouvik Das23-Jan-07 20:19 
GeneralRe: Base Address Pin
Shouvik Das23-Jan-07 20:21
Shouvik Das23-Jan-07 20:21 
GeneralRe: Base Address Pin
Stephen Hewitt23-Jan-07 20:25
Stephen Hewitt23-Jan-07 20:25 
GeneralRe: Base Address Pin
Shouvik Das23-Jan-07 20:31
Shouvik Das23-Jan-07 20:31 
GeneralRe: Base Address Pin
Shouvik Das24-Jan-07 3:46
Shouvik Das24-Jan-07 3:46 
AnswerRe: Base Address Pin
Shouvik Das24-Jan-07 4:39
Shouvik Das24-Jan-07 4:39 
GeneralRe: Base Address Pin
Shouvik Das24-Jan-07 4:48
Shouvik Das24-Jan-07 4:48 
Questionhow to send smtp commands Pin
neha.agarwal2723-Jan-07 18:25
neha.agarwal2723-Jan-07 18:25 
QuestionMoving from wCE 4 to vs 2005 Pin
AlexEvans23-Jan-07 18:22
AlexEvans23-Jan-07 18:22 
QuestionConversion Pin
Subramaniam s.V.23-Jan-07 17:56
Subramaniam s.V.23-Jan-07 17:56 
AnswerRe: Conversion Pin
Christian Graus23-Jan-07 18:10
protectorChristian Graus23-Jan-07 18:10 
GeneralRe: Conversion Pin
Subramaniam s.V.23-Jan-07 18:14
Subramaniam s.V.23-Jan-07 18:14 
Questionx-y graph Pin
Aint23-Jan-07 17:27
Aint23-Jan-07 17:27 
AnswerRe: x-y graph Pin
Christian Graus23-Jan-07 17:37
protectorChristian Graus23-Jan-07 17:37 
AnswerRe: x-y graph Pin
ThatsAlok23-Jan-07 18:42
ThatsAlok23-Jan-07 18:42 
GeneralRe: x-y graph Pin
Aint23-Jan-07 20:04
Aint23-Jan-07 20:04 
AnswerRe: x-y graph Pin
Cedric Moonen23-Jan-07 20:07
Cedric Moonen23-Jan-07 20:07 

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.