Click here to Skip to main content
15,892,575 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCalling COM from C [modified] Pin
Fayu22-Apr-10 10:19
Fayu22-Apr-10 10:19 
AnswerRe: Calling COM from C Pin
Gwenio22-Apr-10 10:50
Gwenio22-Apr-10 10:50 
AnswerRe: Calling COM from C Pin
Richard MacCutchan22-Apr-10 11:09
mveRichard MacCutchan22-Apr-10 11:09 
QuestionGetting absolute address of variable in memory Pin
chapultec22-Apr-10 10:10
chapultec22-Apr-10 10:10 
AnswerRe: Getting absolute address of variable in memory Pin
Gwenio22-Apr-10 11:01
Gwenio22-Apr-10 11:01 
GeneralRe: Getting absolute address of variable in memory Pin
chapultec22-Apr-10 14:23
chapultec22-Apr-10 14:23 
GeneralRe: Getting absolute address of variable in memory Pin
CPallini22-Apr-10 21:57
mveCPallini22-Apr-10 21:57 
AnswerRe: Getting absolute address of variable in memory Pin
Stephen Hewitt22-Apr-10 13:58
Stephen Hewitt22-Apr-10 13:58 
First some problems with your code.

chapultec wrote:
iTest = atoi((char *) argv[1]);

This is wrong. The type of the arguments is _TCHAR* argv[] so to assume the strings contained in the array are char*s is wrong. It should be something like this:
iTest = _ttoi(argv[1])

In general casting something into something it isn't (when the program is compiled as Unicode) doesn't transform it, it just tells the compiler to plough on and assume it is.

chapultec wrote:
// Though the pointer &iTest is the same, each instance
// prints its own value !!


Each process has its own memory space, even two instances of the same process. To get the behaviour you seem to be expecting you'd have to use shared memory. Address spaces are visualised by the OS (with hardware support) and an address in a process is not the physical address of the memory. The only place you'd use physical addresses is in device drivers, and even then only in certain circumstances (like telling some piece of hardware to perform a DMA operation).
Steve

GeneralRe: Getting absolute address of variable in memory Pin
chapultec22-Apr-10 14:33
chapultec22-Apr-10 14:33 
AnswerRe: Getting absolute address of variable in memory Pin
Luc Pattyn22-Apr-10 14:28
sitebuilderLuc Pattyn22-Apr-10 14:28 
AnswerRe: Getting absolute address of variable in memory Pin
Michel Godfroid23-Apr-10 1:34
Michel Godfroid23-Apr-10 1:34 
GeneralI'm looking for a partner to help each other Pin
fyl22222-Apr-10 6:57
fyl22222-Apr-10 6:57 
GeneralRe: I'm looking for a partner to help each other Pin
loyal ginger22-Apr-10 7:43
loyal ginger22-Apr-10 7:43 
QuestionCreate Handle on Remote Disk or Volume Pin
GaryT8022-Apr-10 5:57
GaryT8022-Apr-10 5:57 
AnswerRe: Create Handle on Remote Disk or Volume Pin
Michel Godfroid22-Apr-10 7:34
Michel Godfroid22-Apr-10 7:34 
QuestionMigrating code from VS6 to vs 2008 Reloaded Pin
Jim Crafton22-Apr-10 5:18
Jim Crafton22-Apr-10 5:18 
AnswerRe: Migrating code from VS6 to vs 2008 Reloaded Pin
Joe Woodbury22-Apr-10 8:23
professionalJoe Woodbury22-Apr-10 8:23 
GeneralRe: Migrating code from VS6 to vs 2008 Reloaded Pin
Jim Crafton22-Apr-10 8:24
Jim Crafton22-Apr-10 8:24 
GeneralRe: Migrating code from VS6 to vs 2008 Reloaded Pin
Maximilien22-Apr-10 10:14
Maximilien22-Apr-10 10:14 
GeneralRe: Migrating code from VS6 to vs 2008 Reloaded Pin
Jim Crafton22-Apr-10 10:17
Jim Crafton22-Apr-10 10:17 
QuestionClass View - "Add" menu item is missing for some classes. Pin
Mike Doner22-Apr-10 4:54
Mike Doner22-Apr-10 4:54 
Questionwindow handle of a key pressed Pin
Srivathsa_22-Apr-10 3:55
Srivathsa_22-Apr-10 3:55 
AnswerRe: window handle of a key pressed Pin
Code-o-mat22-Apr-10 4:46
Code-o-mat22-Apr-10 4:46 
GeneralRe: window handle of a key pressed Pin
Srivathsa_22-Apr-10 4:48
Srivathsa_22-Apr-10 4:48 
AnswerRe: window handle of a key pressed Pin
Stephen Hewitt22-Apr-10 5:11
Stephen Hewitt22-Apr-10 5:11 

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.