Click here to Skip to main content
15,893,266 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: unexpected end of file while looking for precompiled header directive Pin
Michael Dunn10-Mar-06 16:15
sitebuilderMichael Dunn10-Mar-06 16:15 
QuestionIHTMLDOMNode and IHTMLElement and leading spaces Pin
mcahriman10-Mar-06 10:59
mcahriman10-Mar-06 10:59 
AnswerRe: IHTMLDOMNode and IHTMLElement and leading spaces Pin
Gerald Schwab10-Mar-06 12:00
Gerald Schwab10-Mar-06 12:00 
GeneralRe: IHTMLDOMNode and IHTMLElement and leading spaces Pin
mcahriman14-Mar-06 6:56
mcahriman14-Mar-06 6:56 
QuestionExecute program Pin
sam117310-Mar-06 10:39
sam117310-Mar-06 10:39 
AnswerRe: Execute program Pin
georgeraafat10-Mar-06 13:48
georgeraafat10-Mar-06 13:48 
QuestionReadProcessMemory alternative Pin
MaTTEvIL10-Mar-06 10:18
MaTTEvIL10-Mar-06 10:18 
AnswerRe: ReadProcessMemory alternative Pin
Dan McCormick10-Mar-06 11:52
Dan McCormick10-Mar-06 11:52 
Is this value in the process that is doing the 'read' or is it in a different process?

If it's in the same process, then assuming that 0x0BADC0DE is the virtual address of the DWORD you want to fetch, the following code will get it:
<br />
DWORD dwAddress = 0x0BADC0DE;<br />
DWORD dwValue = * reinterpret_cast<DWORD *>( dwAddress );<br />

If you specify an invalid virtual address, you will generate an access fault at runtime. This technique is generally used only in very low-level code that does not run in a virtual memory space to access memory-mapped hardware devices. It's not something that is very useful in a Windows Application and it would generally be considered very poor programming style.

If you need to read memory in a different process, then you must use ReadProcessMemory(). Each process has it's own self-contained virtual address space. There is no way to define a simple pointer into the address space of another process.

If you are in control of the source for both processes then you could set up shared memory between the two, or possibly some other mechanism for getting the value. Can you tell us a little more about what the value represents, how often you need to read it, etc? More information might let us suggest a better method of sharing this value.

Dan

Remember kids, we're trained professionals.
Don't try this at home!

Questionclosing MFC dialog app Pin
viperlogic10-Mar-06 8:28
viperlogic10-Mar-06 8:28 
AnswerRe: closing MFC dialog app Pin
Michael Dunn10-Mar-06 8:38
sitebuilderMichael Dunn10-Mar-06 8:38 
GeneralRe: closing MFC dialog app Pin
viperlogic10-Mar-06 8:52
viperlogic10-Mar-06 8:52 
AnswerRe: closing MFC dialog app Pin
MANISH RASTOGI10-Mar-06 17:36
MANISH RASTOGI10-Mar-06 17:36 
QuestionIs it true that if GetActiveView() returns NULL then Our Application Does not Support Doc/view. Pin
CodeVarma10-Mar-06 7:35
CodeVarma10-Mar-06 7:35 
AnswerRe: Is it true that if GetActiveView() returns NULL then Our Application Does not Support Doc/view. Pin
Intertherain10-Mar-06 16:08
Intertherain10-Mar-06 16:08 
QuestionOnInitialUpdate CSplitterWnd Pin
23_44410-Mar-06 7:01
23_44410-Mar-06 7:01 
QuestionRe: OnInitialUpdate CSplitterWnd Pin
David Crow10-Mar-06 8:28
David Crow10-Mar-06 8:28 
AnswerRe: OnInitialUpdate CSplitterWnd Pin
23_44410-Mar-06 8:37
23_44410-Mar-06 8:37 
Questiontxt file Pin
chaitanya2210-Mar-06 6:22
chaitanya2210-Mar-06 6:22 
QuestionRe: txt file Pin
David Crow10-Mar-06 6:34
David Crow10-Mar-06 6:34 
AnswerRe: txt file Pin
chaitanya2211-Mar-06 0:23
chaitanya2211-Mar-06 0:23 
GeneralRe: txt file Pin
David Crow13-Mar-06 2:42
David Crow13-Mar-06 2:42 
AnswerRe: txt file Pin
Hamid_RT10-Mar-06 6:54
Hamid_RT10-Mar-06 6:54 
AnswerRe: txt file Pin
gamitech10-Mar-06 7:01
gamitech10-Mar-06 7:01 
AnswerRe: txt file Pin
ThatsAlok10-Mar-06 18:19
ThatsAlok10-Mar-06 18:19 
QuestionFeature lock and unlock Pin
raybert10-Mar-06 6:18
raybert10-Mar-06 6:18 

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.