Click here to Skip to main content
16,004,974 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Help I am new to C++ Pin
Bob Flynn17-Oct-05 8:18
Bob Flynn17-Oct-05 8:18 
AnswerRe: Help I am new to C++ Pin
Christian Graus17-Oct-05 12:07
protectorChristian Graus17-Oct-05 12:07 
AnswerRe: Help I am new to C++ Pin
TheGreatAndPowerfulOz19-Oct-05 11:28
TheGreatAndPowerfulOz19-Oct-05 11:28 
GeneralRe: Help I am new to C++ Pin
Anonymous20-Oct-05 5:06
Anonymous20-Oct-05 5:06 
QuestionDataSource Wrapping Native C++ Example? Pin
Jared McIntyre17-Oct-05 7:43
Jared McIntyre17-Oct-05 7:43 
AnswerRadar and C++, GUI, VxWorks, Tornado Pin
Anonymous17-Oct-05 9:13
Anonymous17-Oct-05 9:13 
GeneralRe: Radar and C++, GUI, VxWorks, Tornado Pin
Anonymous17-Oct-05 9:17
Anonymous17-Oct-05 9:17 
QuestionControl::Invoke Pin
istrasci17-Oct-05 7:09
istrasci17-Oct-05 7:09 
I am doing some responsive UI stuff in my program, and my (ThreadPool) thread needs some information from the UI, so it has to call Control::Invoke to get the main UI thread to do some querying... This method passes back some status information through the return value, and I can get the ThreadPool thread to do various actions based on the state... My problem is, sometimes I need more than one piece of information, and would like to pass this additional information out through pointer parameters of the method... Now, the Control::Invoke method has the signature (the one of importance to me):

public: virtual Object* Invoke(Delegate*, Object[]);

So I have to stick the parameters for the method to be invoked into an Object[], which means boxing value types... However, for the pointer arguments (where I expect to get further information passed back out), this is where I'm having problems... I can't use the pointer directly, and I can't box it... I tried using the System::Reflection::Pointer::Box() method, but then I couldn't use the pointer as expected in the method... Maybe I was doing something wrong, but I would unbox it, then manipulate it... Do I need to box it back up before the function terminates, then unbox it again after the Control::Invoke call to get the value stored there...??? Am I missing something...??? Is there another way to do it, or is this a lost cause??? Any help would be greatly appreciated!!! Below is a pseudocode summary of my problem... Thanks...

- istrasci

<br />
On ThreadPool thread:<br />
{<br />
  ...<br />
  // need to Invoke main UI thread since I can't mess<br />
  // with it<br />
  // args is an Object*[4]<br />
  System::Int32 status;<br />
  int *val;<br />
  args[0] = __box(some_val); ...<br />
  args[3] = // need to use val here<br />
<br />
  status = *dynamic_cast<System::Int32*><br />
              (Invoke(myDelegate, args));<br />
  ...<br />
  // use status and val here<br />
}<br />
<br />
On main UI thread:<br />
// delegate matches this sig<br />
System::Int32 method(int a, int b, int c, int *d)<br />
{<br />
  // call some function, get a char *str of the<br />
  // form '<int1> <int2> <int3>'<br />
  // print str to a Textbox in UI via some clever<br />
  // manipulation<br />
  // parse str for <int3><br />
  *d = int3;<br />
<br />
  return <status info>;<br />
}

AnswerRe: Control::Invoke Pin
istrasci17-Oct-05 9:48
istrasci17-Oct-05 9:48 
QuestionLoading cursor problem (MFC) Pin
Vladimir D17-Oct-05 6:29
Vladimir D17-Oct-05 6:29 
Question&quot;Poject help&quot; Pin
da_comp_learner16-Oct-05 18:36
da_comp_learner16-Oct-05 18:36 
QuestionThis application has requested the Runtime to terminate it in an unusual way. Pin
Lord Kixdemp15-Oct-05 15:01
Lord Kixdemp15-Oct-05 15:01 
QuestionVC++ 6.0 &amp; .NET 2003 Pin
Nuray15-Oct-05 4:06
Nuray15-Oct-05 4:06 
AnswerRe: VC++ 6.0 &amp; .NET 2003 Pin
Nemanja Trifunovic15-Oct-05 5:29
Nemanja Trifunovic15-Oct-05 5:29 
AnswerRe: VC++ 6.0 &amp; .NET 2003 Pin
Christian Graus16-Oct-05 13:30
protectorChristian Graus16-Oct-05 13:30 
GeneralRe: VC++ 6.0 &amp; .NET 2003 Pin
Nuray17-Oct-05 0:51
Nuray17-Oct-05 0:51 
GeneralRe: VC++ 6.0 &amp; .NET 2003 Pin
Christian Graus17-Oct-05 1:40
protectorChristian Graus17-Oct-05 1:40 
GeneralRe: VC++ 6.0 &amp; .NET 2003 Pin
Nuray17-Oct-05 3:31
Nuray17-Oct-05 3:31 
GeneralRe: VC++ 6.0 &amp; .NET 2003 Pin
Christian Graus17-Oct-05 11:55
protectorChristian Graus17-Oct-05 11:55 
GeneralRe: VC++ 6.0 &amp; .NET 2003 Pin
Nuray19-Oct-05 2:40
Nuray19-Oct-05 2:40 
GeneralRe: VC++ 6.0 &amp; .NET 2003 Pin
Christian Graus20-Oct-05 9:47
protectorChristian Graus20-Oct-05 9:47 
QuestionWrite/read Windows registry? Pin
Lord Kixdemp14-Oct-05 14:35
Lord Kixdemp14-Oct-05 14:35 
AnswerRe: Write/read Windows registry? Pin
RFOG15-Oct-05 1:03
RFOG15-Oct-05 1:03 
GeneralRe: Write/read Windows registry? Pin
Lord Kixdemp15-Oct-05 6:28
Lord Kixdemp15-Oct-05 6:28 
Questionvariables Pin
Anonymous14-Oct-05 11:28
Anonymous14-Oct-05 11:28 

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.