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

Managed C++/CLI

 
GeneralRe: Calling managed function from unmanaged function [modified] Pin
santoshkaif10-Sep-09 7:21
santoshkaif10-Sep-09 7:21 
GeneralRe: Calling managed function from unmanaged function Pin
N a v a n e e t h10-Sep-09 16:10
N a v a n e e t h10-Sep-09 16:10 
GeneralRe: Calling managed function from unmanaged function Pin
santoshkaif10-Sep-09 18:43
santoshkaif10-Sep-09 18:43 
QuestionRe: Calling managed function from unmanaged function Pin
santoshkaif21-Sep-09 2:20
santoshkaif21-Sep-09 2:20 
AnswerRe: Calling managed function from unmanaged function Pin
N a v a n e e t h22-Sep-09 15:31
N a v a n e e t h22-Sep-09 15:31 
QuestionMultiple Forms in VS2005 Pin
rtshield6-Sep-09 15:17
rtshield6-Sep-09 15:17 
AnswerRe: Multiple Forms in VS2005 Pin
N a v a n e e t h6-Sep-09 15:58
N a v a n e e t h6-Sep-09 15:58 
QuestionWeird problem with writing to a label in a form. (VC++ 2008) Pin
alzaeem4-Sep-09 6:55
alzaeem4-Sep-09 6:55 
Hi,

I have a function to display 3 values to the user by writing them to 3 labels. Basically there is some intensive data processing going on in the background by native C++ code. every now and then the data processing calculates these three numbers and signals an Event Object. A function in the mnaged form class waits for this Event to be set, and when that happens it will write these 3 numbers, and also plot some data.

Here is the function:
private: void updateNoise(void){
			 
			 double temp = global->_noise_value[0];
			 this->noiseLabel1->Text = L"Coil 1 Noise:" + temp.ToString();
			 temp = global->_noise_value[1];
			 this->noiseLabel2->Text = L"Coil 2 Noise:" + temp.ToString();
			 temp = global->_noise_value[2];
			 this->noiseLabel3->Text = L"Coil 3 Noise:" + temp.ToString();

		 }

I know this code works because if I call it in a simple event like a button-click without the data processing running it will correctly write doubles to the labels, but when it is called in the middle of my program, well in the debugger the first line copies a value correctly, but the function returns when it executes the second line.

Here is the code for waiting for an event:
int rc = WaitForSingleObject(global->_startPlotEvent, 1000); //see if plotting event has been set (wait for 1 second on each wait).
switch (rc){
    case WAIT_OBJECT_0:
        for (int i=0; i<3; i++)
            this->drawPlot(i);   //update plots
        this->updateNoise(); //update Noise Entries.
        break;

    case WAIT_TIMEOUT:
        //hasn't been signaled yet
        break;

    default:
        assert(0);//error
}


Also I know this method works because plotting works fine everytime as long as updateNoise is not called before drawPlot.

So any idea what is behind this problem? I am new to .NET and C++/CLI but it makes no sense why this wouldn't work.
AnswerRe: Weird problem with writing to a label in a form. (VC++ 2008) Pin
N a v a n e e t h4-Sep-09 18:12
N a v a n e e t h4-Sep-09 18:12 
GeneralRe: Weird problem with writing to a label in a form. (VC++ 2008) Pin
alzaeem5-Sep-09 17:32
alzaeem5-Sep-09 17:32 
AnswerRe: Weird problem with writing to a label in a form. (VC++ 2008) Pin
Luc Pattyn6-Sep-09 1:20
sitebuilderLuc Pattyn6-Sep-09 1:20 
Questionmodify a DLL(binary) to call another DLL function/exe or embed a code...I need some concepts clarification Pin
Member 43963092-Sep-09 21:58
Member 43963092-Sep-09 21:58 
AnswerRe: modify a DLL(binary) to call another DLL function/exe or embed a code...I need some concepts clarification Pin
Richard MacCutchan3-Sep-09 2:24
mveRichard MacCutchan3-Sep-09 2:24 
Questionthe error in managed c++ function call unmanaged c++ function Pin
jetjeankimo2-Sep-09 17:43
jetjeankimo2-Sep-09 17:43 
AnswerRe: the error in managed c++ function call unmanaged c++ function Pin
N a v a n e e t h3-Sep-09 0:00
N a v a n e e t h3-Sep-09 0:00 
GeneralRe: the error in managed c++ function call unmanaged c++ function Pin
jetjeankimo3-Sep-09 16:12
jetjeankimo3-Sep-09 16:12 
GeneralRe: the error in managed c++ function call unmanaged c++ function Pin
N a v a n e e t h4-Sep-09 5:59
N a v a n e e t h4-Sep-09 5:59 
GeneralRe: the error in managed c++ function call unmanaged c++ function Pin
jetjeankimo4-Sep-09 16:31
jetjeankimo4-Sep-09 16:31 
GeneralRe: the error in managed c++ function call unmanaged c++ function Pin
N a v a n e e t h4-Sep-09 17:51
N a v a n e e t h4-Sep-09 17:51 
GeneralRe: the error in managed c++ function call unmanaged c++ function Pin
jetjeankimo4-Sep-09 18:21
jetjeankimo4-Sep-09 18:21 
GeneralRe: the error in managed c++ function call unmanaged c++ function Pin
jetjeankimo5-Sep-09 21:33
jetjeankimo5-Sep-09 21:33 
QuestionSpy++ Pin
ant-damage2-Sep-09 2:19
ant-damage2-Sep-09 2:19 
AnswerRe: Spy++ Pin
Randor 2-Sep-09 10:20
professional Randor 2-Sep-09 10:20 
GeneralRe: Spy++ Pin
ant-damage3-Sep-09 4:22
ant-damage3-Sep-09 4:22 
GeneralRe: Spy++ Pin
EliottA3-Sep-09 5:13
EliottA3-Sep-09 5:13 

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.