买回了一台商场POS机前台显示屏,是用COM口来显示的,请问是用那个函数获取COM口,比如COM1,然后将要的文字显示出去?解决马上结贴。

解决方案 »

  1.   

    CreateFile
    ReadFile
    WriteFile
    CloseFile
      

  2.   

    串口通讯程序,BOOL bReadStatus;
    bReadStatus = ReadFile( m_hIDComDev, buffer,
    dwBytesRead, &&dwBytesRead, &&m_OverlappedRead );
    if(!bReadStatus){
    if(GetLastError()==ERROR_IO_PENDING){
    WaitForSingleObject(m_OverlappedRead.hEvent,1000);
    return ((int)dwBytesRead);}
    return(0);}
    return ((int)dwBytesRead); 
      

  3.   

    http://www.vckbase.com/code/listcode.asp?mclsid=9&sclsid=907你去这里看看,你想要什么就有什么