Click here to Skip to main content
15,903,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 10:26
Jamie Hale10-Sep-03 10:26 
GeneralRe: CFile::GetFilePath() setting error Pin
David Crow10-Sep-03 10:38
David Crow10-Sep-03 10:38 
GeneralRe: CFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 10:46
Jamie Hale10-Sep-03 10:46 
GeneralRe: CFile::GetFilePath() setting error Pin
David Crow11-Sep-03 2:27
David Crow11-Sep-03 2:27 
GeneralRe: CFile::GetFilePath() setting error Pin
Alvaro Mendez10-Sep-03 8:13
Alvaro Mendez10-Sep-03 8:13 
GeneralRe: CFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 8:33
Jamie Hale10-Sep-03 8:33 
GeneralCOM port Access Pin
wogerdoger10-Sep-03 6:54
wogerdoger10-Sep-03 6:54 
GeneralRe: COM port Access Pin
Anonymous10-Sep-03 8:01
Anonymous10-Sep-03 8:01 
Hello

Here is the way how i did it.

Create a ActiveX Contrl-->Microsoft Communication Control32.
and add a member Variable for it.
Create a OnComm Event with the Wizard.

Open the Port with:
m_MSComm is the member variable for the Active X Control
  m_MSComm.SetCommPort(1);<br />
m_MSComm.SetSettings(9600,N,8,1);//DCB in the help file         m_MSComm.SetHandshaking(0);<br />
m_MSComm.SetInputLen(1);<br />
m_MSComm.SetRThreshold(1);<br />
m_MSComm.SetDTREnable(false);<br />
m_MSComm.SetRTSEnable(false);<br />
m_MSComm.SetPortOpen(true);

Close the Port:
m_MSComm.SetPortOpen(false);
Send a Byte
<br />
                m_MSComm.SetRTSEnable(true);<br />
		CString str; <br />
                str= //add the string you want to send<br />
		vVar.vt = VT_BSTR;<br />
		vVar.bstrVal=str.AllocSysString();<br />
		m_MSComm.SetOutput(vVar);<br />
		SysFreeString(vVar.bstrVal);<br />
	        m_MSComm.SetRTSEnable(false);<br />

Recieve something:

<br />
//COODE GENERATED BY THE WIZARD!<br />
BEGIN_EVENTSINK_MAP(CMainDlg, CDialog)<br />
    //{{AFX_EVENTSINK_MAP(CMainDlg)<br />
	ON_EVENT(CMainDlg, IDC_MSCOMM, 1 /* OnComm */, OnMscomm, VTS_NONE)<br />
	//}}AFX_EVENTSINK_MAP<br />
END_EVENTSINK_MAP()<br />
//COODE GENERATED BY THE WIZARD END!<br />
<br />
//Called by an event of the COM<br />
<br />
void CMainDlg::OnMscomm() <br />
{<br />
	// TODO: Add your control notification handler code here<br />
	switch(m_MSComm.GetCommEvent())<br />
	{<br />
		case 2: // CommEvReceive:<br />
			CString Empf=m_MSComm.GetInput());<br />
			break;<br />
	}	<br />
	<br />
}<br />

That should it be.

Mfg DarkMarine.
DarkMarine@aon.at
GeneralRe: COM port Access Pin
wogerdoger10-Sep-03 12:31
wogerdoger10-Sep-03 12:31 
GeneralRe: COM port Access Pin
DarkMarine11-Sep-03 8:18
DarkMarine11-Sep-03 8:18 
QuestionHow to catch an exception in dll? Pin
Eugene Pustovoyt10-Sep-03 6:43
Eugene Pustovoyt10-Sep-03 6:43 
AnswerRe: How to catch an exception in dll? Pin
David Crow10-Sep-03 6:52
David Crow10-Sep-03 6:52 
GeneralRe: How to catch an exception in dll? Pin
Eugene Pustovoyt10-Sep-03 7:57
Eugene Pustovoyt10-Sep-03 7:57 
GeneralRe: How to catch an exception in dll? Pin
David Crow10-Sep-03 8:02
David Crow10-Sep-03 8:02 
GeneralRe: How to catch an exception in dll? Pin
Alvaro Mendez10-Sep-03 8:23
Alvaro Mendez10-Sep-03 8:23 
AnswerRe: How to catch an exception in dll? Pin
Joel Lucsy10-Sep-03 11:19
Joel Lucsy10-Sep-03 11:19 
GeneralThanks to everybody. catch( ... ) works Pin
Eugene Pustovoyt10-Sep-03 18:03
Eugene Pustovoyt10-Sep-03 18:03 
Questionhow to commuicate with a web server Pin
Stober10-Sep-03 6:32
Stober10-Sep-03 6:32 
AnswerRe: how to commuicate with a web server Pin
valikac10-Sep-03 9:08
valikac10-Sep-03 9:08 
Question'lrint' equivalent? Pin
ns10-Sep-03 6:23
ns10-Sep-03 6:23 
AnswerRe: 'lrint' equivalent? Pin
David Crow10-Sep-03 6:55
David Crow10-Sep-03 6:55 
GeneralODBC Datasources Pin
si_6910-Sep-03 5:46
si_6910-Sep-03 5:46 
GeneralRe: ODBC Datasources Pin
David Crow10-Sep-03 6:13
David Crow10-Sep-03 6:13 
GeneralHTML syntax highlighting concepts Pin
mcguile25710-Sep-03 5:26
mcguile25710-Sep-03 5:26 
GeneralRe: HTML syntax highlighting concepts Pin
Phil Hamer10-Sep-03 9:20
Phil Hamer10-Sep-03 9:20 

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.