RE: Glib::ustring



This is in the class

int CSerial::SendData( const char *buffer, int size )
{

	if( !m_bOpened || m_hIDComDev == NULL ) return( 0 );

	DWORD dwBytesWritten = 0;
	int i;
	for( i=0; i<size; i++ ){
		WriteCommByte( buffer[i] );
		dwBytesWritten++;
		}

	return( (int) dwBytesWritten );

}





I am using it from


void Connect_Dialog::on_button_connectar()
{
  CSerial serial;
  if (serial.Open(1, 9600))
  {
      char* szMessage;
      
    
	szMessage= m_Entry1.get_text();   ///here is the error "cannot
convert `Glib::ustring' to `char' in assignment"..
     

      
     int nBytesSent = serial.SendData(szMessage, strlen(szMessage));
     assert(nBytesSent == strlen(szMessage));
     
      Gtk::MessageDialog dialog(szMessage ,false, Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK, true);
      dialog.run();
     }
     else
         {
         
   
         Gtk::MessageDialog dialog("Error no se pudo abrir puerto para
escritura", false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, true); 
          dialog.run();
      }
                       

}

-----Original Message-----
From: gtkmm-list-bounces gnome org [mailto:gtkmm-list-bounces gnome org] On
Behalf Of Hubert Figuiere
Sent: Wednesday, March 05, 2008 8:59 PM
To: gtkmm-list gnome org
Subject: Re: Glib::ustring


On Wed, 2008-03-05 at 20:48 -0600, Jorge Luis Vidales Valladares wrote:
> Any ideas. Thanks


any code snippet to show?

Hub

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.3/1308 - Release Date: 3/3/2008
10:01 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.3/1308 - Release Date: 3/3/2008
10:01 AM
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]