Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] MFC help: Cstring to Char[]

Status
Not open for further replies.

jawadali477

Member level 1
Joined
Dec 23, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,588
MFC help : code error 0000007B

hi,
i'm developing GUI using MFC in vs2008. i have developed code and it builds fine but when i debug my code, it gives system error 0000007B. part of the code that gives this error is given below + variable initialization.

int COMportNum= 3;
portstream_fd COMstream;
portstream_fd pstream;
char COMportPrefix[10] = "COM";
char COMportName[256];

sprintf(COMportName, "%s%d", COMportPrefix, COMportNum); // initialize serial port COM3

strng = CString(COMportName);
strng.Format(_T("%0.9s"), strng);
SetDlgItemText(IDC_STAT, strng);

set_baud_rate(BaudRate);
COMstream = open_host_port(COMportName); //opens serial port COM3

if ( COMstream == PORT_NOT_OPENED ) //conditional check if COM3 is opened
{
stw.Format(_T("%08X"), GetLastError()); //generates error if any
SetDlgItemText(IDC_PTUPORT, stw);
}
else
SetDlgItemText(IDC_PTUPORT, (LPCTSTR) L"Ok");


can anyone please help me with this error.

Regards
Jawad

In order for the syntax or any tags to be applied you have to put the code between the syntax and /syntax and not after them [alexan_e]
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top