ActiveX với EVC++4.0 lỗi ở đâu?

vuthuanbkvn

New member
GÂY DỰNG
em không thể lập trình ActiveX trên EVC++4.0,trong khi đó em cài VC++6.0 thì có đầy đủ,em đã tìm MSCOMM.OCX về register nhưng không đc?? có phải em cài thiếu cái gì?
hic hic,muốn chuyển sang VC++6.0 thì không biết tìm SDK phù hợp cho nó để có thể lập trình đc con PPC2003?? ai biết chỉ dùm em? em vào microsoft thì thấy nhìu quá đâm ra sợ,hoảng???
 
cần giúp
//portname= "//./" +portname;
HANDLE hComm = CreateFile(TEXT("COM3:"),
GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
if(hComm == INVALID_HANDLE_VALUE)
{
MessageBox(TEXT("CHUA KET NOI THANH CONG???"), TEXT("Error!"), MB_OK);
return false;
}
else
{
MessageBox(TEXT("Ket noi thanh cong"), TEXT("Bat dau thuc hien dieu khien"), MB_OK);
return true;
}

}
///////////////////////////////////////////////////////////////////////////
//ConfigurePort
//////////////////////////////////////////////////////////////////////////


BOOL CSerialCom::ConfigurePort(DWORD BaudRate, BYTE ByteSize,
DWORD Parity, BYTE fParity, BYTE StopBits)
{
////////////////////////////////////////
//structure containing the device configuration settings when the function returns.
//If the call is successful, the function returns a TRUE value
////////////////////////////////////////
COMMPROP commProp;
memset(&commProp, 0, sizeof(COMMPROP));
GetCommProperties(hComm, &commProp);
//////////////////////////////////////////
//DCB m_dcb;

memset(&m_dcb, 0, sizeof(DCB));
/////////////////////////////////////////

BOOL fSuccess = FALSE;
memset(&m_dcb, 0, sizeof(DCB));

// The the current communication port settings
if(GetCommState(hComm, &m_dcb))
{
// Can we change the settings? Let's check the commProp
if(commProp.dwSettableParams && SP_BAUD) {
m_dcb.BaudRate = BAUD_9600;
m_dcb.Parity = 0;
m_dcb.fParity = PARITY_NONE;
m_dcb.StopBits = ONESTOPBIT;
m_dcb.ByteSize = 8;
fSuccess = SetCommState(hComm, &m_dcb);
}
return true;
}

if(fSuccess==0)
{
MessageBox(TEXT("Could not modify the port's settings"),TEXT("Error!"), MB_OK);
}
else
MessageBox(TEXT("thanh cong"),TEXT("thanh cong"), MB_OK);
return true;
--------------->>>> tại sao ko thể thanh công được??
 
fSuccess==0 ---->>> tại sao vậy??? em kiểm tra kỹ rồi??chảng sai ở đâu?tại sao ko thể thiết lập cấu hình cho cái cổng COM,em dùng EVC++4.0 và ppc2003??
 
Back
Top