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

Managed C++/CLI

 
QuestionConvert Native Pointer to IntPtr Pin
Richard Andrew x6422-May-21 4:44
professionalRichard Andrew x6422-May-21 4:44 
AnswerRe: Convert Native Pointer to IntPtr Pin
Richard MacCutchan22-May-21 4:47
mveRichard MacCutchan22-May-21 4:47 
GeneralRe: Convert Native Pointer to IntPtr Pin
Richard Andrew x6422-May-21 4:51
professionalRichard Andrew x6422-May-21 4:51 
QuestionBackgammon Game Pin
basel3322-May-21 2:25
basel3322-May-21 2:25 
AnswerRe: Backgammon Game Pin
Richard MacCutchan22-May-21 3:13
mveRichard MacCutchan22-May-21 3:13 
QuestionSerial Port BytesToRead always 0 Pin
yehiga146721-May-21 0:16
yehiga146721-May-21 0:16 
QuestionRe: Serial Port BytesToRead always 0 Pin
Richard MacCutchan21-May-21 0:59
mveRichard MacCutchan21-May-21 0:59 
AnswerRe: Serial Port BytesToRead always 0 Pin
cibec75455@frnla.com21-May-21 1:29
cibec75455@frnla.com21-May-21 1:29 
GeneralRe: Serial Port BytesToRead always 0 Pin
Richard MacCutchan21-May-21 1:38
mveRichard MacCutchan21-May-21 1:38 
GeneralRe: Serial Port BytesToRead always 0 Pin
cibec75455@frnla.com21-May-21 1:47
cibec75455@frnla.com21-May-21 1:47 
QuestionHow to call System::Windows::Forms::Controls "invoke" method? Pin
Member 1515077819-May-21 19:48
Member 1515077819-May-21 19:48 
I made a class myGroupbox to use SerialPort, and I'm trying to update a textbox from the serial port data. But the invoke function couldn't be used, the error message is "myGroupbox has no member invoke"

here's my code


myGroupbox.h
#pragma once
using namespace System::Windows::Forms;
ref class myGroupbox
{
    private: System::IO::Ports::SerialPort^ _serialPort;
    
    public:
    myGroupbox( System::IO::Ports::SerialPort^ serialPort )
    {
    _serialPort=serialPort;
    
            _serialPort->DataReceived += gcnew System::IO::Ports::SerialDataReceivedEventHandler(this, &myGroupbox::SerialPort_DataReceived);
    }
    
  private: 	System::Void SerialPort_DataReceived(System::Object^ sender,System::IO::Ports::SerialDataReceivedEventArgs^ e)
    {
        uint16_t test = 0;

        test = _serialPort->BytesToRead;

        if (test == 3U) {



            this->Invoke(gcnew EventHandler(this, &myGroupbox::ProcessReceived)); // ERROR in this line, Invoke not found
        }
        else
        {
            _serialPort->DiscardInBuffer();
        }
    }

    private: System::Void ProcessReceived(System::Object^ sender, System::EventArgs^ e)
    {

        //set textbox text

    }

}

AnswerRe: How to call System::Windows::Forms::Controls "invoke" method? Pin
Victor Nijegorodov19-May-21 20:28
Victor Nijegorodov19-May-21 20:28 
GeneralRe: How to call System::Windows::Forms::Controls "invoke" method? Pin
Member 1515077819-May-21 20:35
Member 1515077819-May-21 20:35 
GeneralRe: How to call System::Windows::Forms::Controls "invoke" method? Pin
Richard MacCutchan19-May-21 21:09
mveRichard MacCutchan19-May-21 21:09 
GeneralRe: How to call System::Windows::Forms::Controls "invoke" method? Pin
Member 1515077819-May-21 21:20
Member 1515077819-May-21 21:20 
QuestionWhat is a preferable approach to develop a common class that handles multiple identical groupbox? Pin
Member 1515077818-May-21 0:41
Member 1515077818-May-21 0:41 
QuestionHow to convert array<System::Byte^>^ to array<unsigned char>^ Pin
Member 1515077812-May-21 18:19
Member 1515077812-May-21 18:19 
QuestionRe: How to convert array<System::Byte^>^ to array<unsigned char>^ Pin
Richard MacCutchan12-May-21 21:05
mveRichard MacCutchan12-May-21 21:05 
AnswerRe: How to convert array<System::Byte^>^ to array<unsigned char>^ Pin
Member 1515077817-May-21 0:06
Member 1515077817-May-21 0:06 
QuestionHow to implement a global variable if C++/CLI doesn't support it at all? Pin
Member 1515077811-May-21 23:29
Member 1515077811-May-21 23:29 
AnswerRe: How to implement a global variable if C++/CLI doesn't support it at all? Pin
Richard MacCutchan11-May-21 23:47
mveRichard MacCutchan11-May-21 23:47 
GeneralRe: How to implement a global variable if C++/CLI doesn't support it at all? Pin
Member 1515077812-May-21 18:30
Member 1515077812-May-21 18:30 
Questioncpp Pin
likith adithya21-Feb-21 23:39
likith adithya21-Feb-21 23:39 
QuestionRe: cpp Pin
Richard MacCutchan21-Feb-21 23:40
mveRichard MacCutchan21-Feb-21 23:40 
AnswerRe: cpp Pin
Richard Deeming22-Feb-21 0:34
mveRichard Deeming22-Feb-21 0:34 

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.