Click here to Skip to main content
15,906,816 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Running a C++/CLI dll from C# Pin
Christian Graus2-Jan-07 10:10
protectorChristian Graus2-Jan-07 10:10 
AnswerRe: Running a C++/CLI dll from C# [modified] Pin
led mike2-Jan-07 10:22
led mike2-Jan-07 10:22 
GeneralRe: Running a C++/CLI dll from C# Pin
Christian Graus2-Jan-07 15:44
protectorChristian Graus2-Jan-07 15:44 
QuestionMoving The Mouse Then Clicking It's Button ? Pin
Fritzables1-Jan-07 12:32
Fritzables1-Jan-07 12:32 
AnswerRe: Moving The Mouse Then Clicking It's Button ? Pin
Christian Graus1-Jan-07 23:54
protectorChristian Graus1-Jan-07 23:54 
GeneralRe: Moving The Mouse Then Clicking It's Button ? Pin
Fritzables2-Jan-07 0:29
Fritzables2-Jan-07 0:29 
QuestionMessage Removed Pin
1-Jan-07 7:58
Armond Sarkisian1-Jan-07 7:58 
AnswerRe: A Little Bit Confused... Pin
Xpnctoc1-Jan-07 9:20
Xpnctoc1-Jan-07 9:20 
I know where the problem is, but let's see if I can word an explanation and make it understandable:

As you know, when you send a value parameter to a function, a copy of that value is made. For instance, changing your function signature to someFunction(int i) would mean that a copy of the value stored in "i" is made. Therefore any changes made to "i" in the function itself would not be saved. The way to get around this is, of course, to pass an address or pointer. Your someFunction(int* p) allows you to change the value stored in p.

When you pass a pointer, instead of a copy of the value being made, a copy of the pointer is made. The type "int*" means you can change the value stored at the int location, but you cannot change the address itself. In assigning NULL, you are of course trying to change the address the pointer points to. However, since a copy of the pointer is made, you are only changing the address the copy points to, and not the address the incoming pointer points to.

In otherwords, if you expect to change the actual address of where the pointer points to, you have to pass to the function a pointer to the pointer. The following revised function should work for you:

void someFunction(int** pp)
{
*pp = NULL;
}

Then when you call the function:

someFunction(&p);


AnswerRe: A Little Bit Confused... Pin
bsaksida1-Jan-07 10:35
bsaksida1-Jan-07 10:35 
QuestionHandle vs. pointer access speed??? Pin
Xpnctoc31-Dec-06 19:22
Xpnctoc31-Dec-06 19:22 
AnswerRe: Handle vs. pointer access speed??? Pin
bsaksida1-Jan-07 2:27
bsaksida1-Jan-07 2:27 
GeneralRe: Handle vs. pointer access speed??? Pin
Xpnctoc1-Jan-07 4:28
Xpnctoc1-Jan-07 4:28 
GeneralRe: Handle vs. pointer access speed??? Pin
bsaksida1-Jan-07 4:37
bsaksida1-Jan-07 4:37 
GeneralRe: Handle vs. pointer access speed??? Pin
Xpnctoc1-Jan-07 5:18
Xpnctoc1-Jan-07 5:18 
AnswerNot what I thought it was... Pin
Xpnctoc1-Jan-07 5:24
Xpnctoc1-Jan-07 5:24 
GeneralRe: Not what I thought it was... Pin
bsaksida1-Jan-07 10:31
bsaksida1-Jan-07 10:31 
QuestionProgram can't run: "The application has failed to start because its side-by-side configuration is incorrect" Pin
Super Lloyd28-Dec-06 13:27
Super Lloyd28-Dec-06 13:27 
AnswerRe: Program can't run: "The application has failed to start because its side-by-side configuration is incorrect" Pin
bsaksida29-Dec-06 0:06
bsaksida29-Dec-06 0:06 
GeneralRe: Program can't run: "The application has failed to start because its side-by-side configuration is incorrect" Pin
Super Lloyd29-Dec-06 1:51
Super Lloyd29-Dec-06 1:51 
GeneralRe: Program can't run: "The application has failed to start because its side-by-side configuration is incorrect" Pin
bsaksida29-Dec-06 2:02
bsaksida29-Dec-06 2:02 
GeneralRe: Program can't run: "The application has failed to start because its side-by-side configuration is incorrect" Pin
Super Lloyd29-Dec-06 11:20
Super Lloyd29-Dec-06 11:20 
AnswerRe: Program can't run: "The application has failed to start because its side-by-side configuration is incorrect" Pin
George L. Jackson29-Dec-06 11:55
George L. Jackson29-Dec-06 11:55 
GeneralRe: Program can't run: "The application has failed to start because its side-by-side configuration is incorrect" Pin
Super Lloyd29-Dec-06 14:31
Super Lloyd29-Dec-06 14:31 
QuestionCompiling Question Pin
bsaksida28-Dec-06 11:04
bsaksida28-Dec-06 11:04 
AnswerRe: Compiling Question Pin
Mark Salsbery28-Dec-06 11:36
Mark Salsbery28-Dec-06 11:36 

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.