⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xlloadlib.cpp

📁 实现了汽车开发领域的can总线pc端的监控程序
💻 CPP
📖 第 1 页 / 共 2 页
字号:
    if ( (xlDllCloseDriver          = (XLCLOSEDRIVER)GetProcAddress(hxlDll,"xlCloseDriver") )==NULL)                             NotFoundAll= 2;
                                                                                                                                  
    // bus independed functions                                                                                                   
    if ( (xlGetApplConfig           = (XLGETAPPLCONFIG)GetProcAddress(hxlDll,"xlGetApplConfig") )==NULL)                         NotFoundAll= 3;
    if ( (xlSetApplConfig           = (XLSETAPPLCONFIG)GetProcAddress(hxlDll,"xlSetApplConfig") )==NULL)                         NotFoundAll= 4;
    if ( (xlGetDriverConfig         = (XLGETDRIVERCONFIG)GetProcAddress(hxlDll,"xlGetDriverConfig") )==NULL)                     NotFoundAll= 5;
    if ( (xlGetChannelIndex         = (XLGETCHANNELINDEX)GetProcAddress(hxlDll,"xlGetChannelIndex") )==NULL)                     NotFoundAll= 6;
    if ( (xlGetChannelMask          = (XLGETCHANNELMASK)GetProcAddress(hxlDll,"xlGetChannelMask") )==NULL)                       NotFoundAll= 7;
    if ( (xlOpenPort                = (XLOPENPORT)GetProcAddress(hxlDll,"xlOpenPort") )==NULL)                                   NotFoundAll= 8;    
    if ( (xlSetTimerRate            = (XLSETTIMERRATE)GetProcAddress(hxlDll,"xlSetTimerRate") )==NULL)                           NotFoundAll= 9;    
    if ( (xlResetClock              = (XLRESETCLOCK)GetProcAddress(hxlDll,"xlResetClock") )==NULL)                               NotFoundAll=10;
    if ( (xlSetNotification         = (XLSETNOTIFICATION)GetProcAddress(hxlDll,"xlSetNotification") )==NULL)                     NotFoundAll=11;
    if ( (xlFlushReceiveQueue       = (XLFLUSHRECEIVEQUEUE)GetProcAddress(hxlDll,"xlFlushReceiveQueue") )==NULL)                 NotFoundAll=12;
    if ( (xlGetReceiveQueueLevel    = (XLGETRECEIVEQUEUELEVEL)GetProcAddress(hxlDll,"xlGetReceiveQueueLevel") )==NULL)           NotFoundAll=13;
    if ( (xlActivateChannel         = (XLACTIVATECHANNEL)GetProcAddress(hxlDll,"xlActivateChannel") )==NULL)                     NotFoundAll=14;
    if ( (xlReceive                 = (XLRECEIVE)GetProcAddress(hxlDll,"xlReceive") )==NULL)                                     NotFoundAll=15;
    if ( (xlGetEventString          = (XLGETEVENTSTRING)GetProcAddress(hxlDll,"xlGetEventString") )==NULL)                       NotFoundAll=16;
    if ( (xlGetErrorString          = (XLGETERRORSTRING)GetProcAddress(hxlDll,"xlGetErrorString") )==NULL)                       NotFoundAll=17;
    if ( (xlGenerateSyncPulse       = (XLGENERATESYNCPULSE)GetProcAddress(hxlDll,"xlGenerateSyncPulse") )==NULL)                 NotFoundAll=18;
    if ( (xlGetSyncTime             = (XLGETSYNCTIME) GetProcAddress(hxlDll,"xlGetSyncTime") )==NULL)                            NotFoundAll=19;
    if ( (xlPopupHwConfig           = (XLPOPUPHWCONFIG)GetProcAddress(hxlDll,"xlPopupHwConfig") )==NULL)                         NotFoundAll=20;
    if ( (xlDeactivateChannel       = (XLDEACTIVATECHANNEL)GetProcAddress(hxlDll,"xlDeactivateChannel") )==NULL)                 NotFoundAll=21;
    if ( (xlClosePort               = (XLCLOSEPORT )GetProcAddress(hxlDll,"xlClosePort") )==NULL)                                NotFoundAll=22;
   
    // CAN specific functions
    if ( (xlCanSetChannelOutput     = (XLCANSETCHANNELOUTPUT)GetProcAddress(hxlDll,"xlCanSetChannelOutput") )==NULL)             NotFoundAll=23;
    if ( (xlCanSetChannelMode       = (XLCANSETCHANNELMODE)GetProcAddress(hxlDll,"xlCanSetChannelMode") )==NULL)                 NotFoundAll=24;
    if ( (xlCanSetReceiveMode       = (XLCANSETRECEIVEMODE)GetProcAddress(hxlDll,"xlCanSetReceiveMode") ) == NULL)               NotFoundAll=25; 
    if ( (xlCanSetChannelTransceiver= (XLCANSETCHANNELTRANSCEIVER)GetProcAddress(hxlDll,"xlCanSetChannelTransceiver") ) == NULL) NotFoundAll=26;
    if ( (xlCanSetChannelParams     = (XLCANSETCHANNELPARAMS)GetProcAddress(hxlDll,"xlCanSetChannelParams") ) == NULL)           NotFoundAll=27;
    if ( (xlCanSetChannelParamsC200 = (XLCANSETCHANNELPARAMSC200)GetProcAddress(hxlDll,"xlCanSetChannelParamsC200") )==NULL)     NotFoundAll=28;
    if ( (xlCanSetChannelBitrate    = (XLCANSETCHANNELBITRATE)GetProcAddress(hxlDll,"xlCanSetChannelBitrate") )==NULL)           NotFoundAll=29; 
    if ( (xlCanSetChannelAcceptance = (XLCANSETCHANNELACCEPTANCE)GetProcAddress(hxlDll,"xlCanSetChannelAcceptance") )==NULL)     NotFoundAll=30;
    if ( (xlCanAddAcceptanceRange   = (XLCANADDACCEPTANCERANGE)GetProcAddress(hxlDll,"xlCanAddAcceptanceRange") )==NULL)         NotFoundAll=31;
    if ( (xlCanRemoveAcceptanceRange= (XLCANREMOVEACCEPTANCERANGE)GetProcAddress(hxlDll,"xlCanRemoveAcceptanceRange") )==NULL)   NotFoundAll=32;
    if ( (xlCanResetAcceptance	    = (XLCANRESETACCEPTANCE)GetProcAddress(hxlDll,"xlCanResetAcceptance") )==NULL)               NotFoundAll=33;
    if ( (xlCanRequestChipState     = (XLCANREQUESTCHIPSTATE)GetProcAddress(hxlDll,"xlCanRequestChipState") )==NULL)             NotFoundAll=34;
    if ( (xlCanFlushTransmitQueue	= (XLCANFLUSHTRANSMITQUEUE)GetProcAddress(hxlDll,"xlCanFlushTransmitQueue") )==NULL)         NotFoundAll=35;  
    if ( (xlCanTransmit             = (XLCANTRANSMIT)GetProcAddress(hxlDll,"xlCanTransmit") )==NULL)                             NotFoundAll=36;                 
    
    // LIN specific functions
    if ( (xlLinSetChannelParams     = (XLLINSETCHANNELPARAMS)GetProcAddress(hxlDll,"xlLinSetChannelParams") )==NULL)             NotFoundAll=37;
    if ( (xlLinSetDLC               = (XLLINSETDLC)GetProcAddress(hxlDll,"xlLinSetDLC") )==NULL)                                 NotFoundAll=38;
    if ( (xlLinSetSlave             = (XLLINSETSLAVE)GetProcAddress(hxlDll,"xlLinSetSlave") )==NULL)                             NotFoundAll=39;
    if ( (xlLinSendRequest          = (XLLINSENDREQUEST)GetProcAddress(hxlDll,"xlLinSendRequest") )==NULL)                       NotFoundAll=40;
    if ( (xlLinWakeUp               = (XLLINWAKEUP) GetProcAddress(hxlDll,"xlLinWakeUp") )==NULL)                                NotFoundAll=41;
    if ( (xlLinSetChecksum          = (XLLINSETCHECKSUM) GetProcAddress(hxlDll,"xlLinSetChecksum") )==NULL)                      NotFoundAll=42;
    if ( (xlLinSwitchSlave          = (XLLINSWITCHSLAVE) GetProcAddress(hxlDll,"xlLinSwitchSlave") )==NULL)                      NotFoundAll=43;

    // IOcab specific functions
    if ( (xlDAIOSetPWMOutput        = (XLDAIOSETPWMOUTPUT)GetProcAddress(hxlDll,"xlDAIOSetPWMOutput") )==NULL)                   NotFoundAll=44;
    if ( (xlDAIOSetDigitalOutput    = (XLDAIOSETDIGITALOUTPUT)GetProcAddress(hxlDll,"xlDAIOSetDigitalOutput") )==NULL)           NotFoundAll=45;
    if ( (xlDAIOSetAnalogOutput     = (XLDAIOSETANALOGOUTPUT)GetProcAddress(hxlDll,"xlDAIOSetAnalogOutput") )==NULL)             NotFoundAll=46;
    if ( (xlDAIORequestMeasurement  = (XLDAIOREQUESTMEASUREMENT)GetProcAddress(hxlDll,"xlDAIORequestMeasurement") )==NULL)       NotFoundAll=47;
    if ( (xlDAIOSetDigitalParameters= (XLDAIOSETDIGITALPARAMETERS) GetProcAddress(hxlDll,"xlDAIOSetDigitalParameters") )==NULL)  NotFoundAll=48;
    if ( (xlDAIOSetAnalogParameters = (XLDAIOSETANALOGPARAMETERS)GetProcAddress(hxlDll,"xlDAIOSetAnalogParameters") )==NULL)     NotFoundAll=49;
    if ( (xlDAIOSetAnalogTrigger    = (XLDAIOSETANALOGTRIGGER) GetProcAddress(hxlDll,"xlDAIOSetAnalogTrigger") )==NULL)          NotFoundAll=50;
    if ( (xlDAIOSetMeasurementFrequency = (XLDAIOSETMEASUREMENTFREQUENCY)GetProcAddress(hxlDll,"xlDAIOSetMeasurementFrequency") )==NULL) NotFoundAll=51;                        
    
    // MOST specific functions
    if ((xlMostReceive              = (XLFP_MOSTRECEIVE) GetProcAddress(hxlDll,"xlMostReceive")) == NULL)                             NotFoundAll=52;
    if ((xlMostCtrlTransmit         = (XLFP_MOSTCTRLTRANSMIT) GetProcAddress(hxlDll,"xlMostCtrlTransmit")) == NULL)                   NotFoundAll=53;
    if ((xlMostSwitchEventSources   = (XLFP_MOSTSWITCHEVENTSOURCES) GetProcAddress(hxlDll,"xlMostSwitchEventSources")) == NULL)       NotFoundAll=54;
    if ((xlMostSetAllBypass         = (XLFP_MOSTSETALLBYPASS) GetProcAddress(hxlDll,"xlMostSetAllBypass")) == NULL)                   NotFoundAll=55;
    if ((xlMostGetAllBypass         = (XLFP_MOSTGETALLBYPASS) GetProcAddress(hxlDll,"xlMostGetAllBypass")) == NULL)                   NotFoundAll=56;
    if ((xlMostSetTimingMode        = (XLFP_MOSTSETTIMINGMODE) GetProcAddress(hxlDll,"xlMostSetTimingMode")) == NULL)                 NotFoundAll=57;
    if ((xlMostGetTimingMode        = (XLFP_MOSTGETTIMINGMODE) GetProcAddress(hxlDll,"xlMostGetTimingMode")) == NULL)                 NotFoundAll=58;
    if ((xlMostSetFrequency         = (XLFP_MOSTSETFREQUENCY) GetProcAddress(hxlDll,"xlMostSetFrequency")) == NULL)                   NotFoundAll=59;
    if ((xlMostGetFrequency         = (XLFP_MOSTGETFREQUENCY) GetProcAddress(hxlDll,"xlMostGetFrequency")) == NULL)                   NotFoundAll=60;
    if ((xlMostWriteRegister        = (XLFP_MOSTWRITEREGISTER) GetProcAddress(hxlDll,"xlMostWriteRegister")) == NULL)                 NotFoundAll=61;
    if ((xlMostReadRegister         = (XLFP_MOSTREADREGISTER) GetProcAddress(hxlDll,"xlMostReadRegister")) == NULL)                   NotFoundAll=62;
    if ((xlMostWriteRegisterBit     = (XLFP_MOSTWRITEREGISTERBIT) GetProcAddress(hxlDll,"xlMostWriteRegisterBit")) == NULL)           NotFoundAll=63;
    if ((xlMostSyncGetAllocTable    = (XLFP_MOSTSYNCGETALLOCTABLE) GetProcAddress(hxlDll,"xlMostSyncGetAllocTable")) == NULL)         NotFoundAll=64;
    if ((xlMostCtrlSyncAudio        = (XLFP_MOSTCTRLSYNCAUDIO) GetProcAddress(hxlDll,"xlMostCtrlSyncAudio")) == NULL)                 NotFoundAll=65;
	if ((xlMostCtrlSyncAudioEx      = (XLFP_MOSTCTRLSYNCAUDIOEX) GetProcAddress(hxlDll,"xlMostCtrlSyncAudioEx")) == NULL)             NotFoundAll=66;
    if ((xlMostSyncVolume           = (XLFP_MOSTSYNCVOLUME) GetProcAddress(hxlDll,"xlMostSyncVolume")) == NULL)                       NotFoundAll=67;
    if ((xlMostSyncMute             = (XLFP_MOSTSYNCMUTE) GetProcAddress(hxlDll,"xlMostSyncMute")) == NULL)                           NotFoundAll=68;
    if ((xlMostSyncGetVolumeStatus  = (XLFP_MOSTSYNCGETVOLUMESTATUS) GetProcAddress(hxlDll,"xlMostSyncGetVolumeStatus")) == NULL)     NotFoundAll=69;
    if ((xlMostSyncGetMuteStatus    = (XLFP_MOSTSYNCGETMUTESTATUS) GetProcAddress(hxlDll,"xlMostSyncGetMuteStatus")) == NULL)         NotFoundAll=70;
    if ((xlMostGetRxLight           = (XLFP_MOSTGETRXLIGHT) GetProcAddress(hxlDll,"xlMostGetRxLight")) == NULL)                       NotFoundAll=71;
    if ((xlMostSetTxLight           = (XLFP_MOSTSETTXLIGHT) GetProcAddress(hxlDll,"xlMostSetTxLight")) == NULL)                       NotFoundAll=72;
    if ((xlMostGetTxLight           = (XLFP_MOSTGETTXLIGHT) GetProcAddress(hxlDll,"xlMostGetTxLight")) == NULL)                       NotFoundAll=73;
    if ((xlMostSetLightPower        = (XLFP_MOSTSETLIGHTPOWER) GetProcAddress(hxlDll,"xlMostSetLightPower")) == NULL)                 NotFoundAll=74;
    if ((xlMostGetLockStatus        = (XLFP_MOSTGETLOCKSTATUS) GetProcAddress(hxlDll,"xlMostGetLockStatus")) == NULL)                 NotFoundAll=75;
    if ((xlMostGenerateLightError   = (XLFP_MOSTGENERATELIGHTERROR) GetProcAddress(hxlDll,"xlMostGenerateLightError")) == NULL)       NotFoundAll=76;
    if ((xlMostGenerateLockError    = (XLFP_MOSTGENERATELOCKERROR) GetProcAddress(hxlDll,"xlMostGenerateLockError")) == NULL)         NotFoundAll=77;
    if ((xlMostCtrlRxBuffer         = (XLFP_MOSTCTRLRXBUFFER) GetProcAddress(hxlDll,"xlMostCtrlRxBuffer")) == NULL)                   NotFoundAll=78;
    if ((xlMostTwinklePowerLed      = (XLFP_MOSTTWINKLEPOWERLED) GetProcAddress(hxlDll,"xlMostTwinklePowerLed")) == NULL)             NotFoundAll=79;
    if ((xlMostAsyncTransmit        = (XLFP_MOSTASYNCTRANSMIT) GetProcAddress(hxlDll,"xlMostAsyncTransmit")) == NULL)                 NotFoundAll=80;
    if ((xlMostCtrlConfigureBusload = (XLFP_MOSTCTRLCONFIGUREBUSLOAD) GetProcAddress(hxlDll,"xlMostCtrlConfigureBusload")) == NULL)   NotFoundAll=81;
    if ((xlMostCtrlGenerateBusload  = (XLFP_MOSTCTRLGENERATEBUSLOAD) GetProcAddress(hxlDll,"xlMostCtrlGenerateBusload")) == NULL)     NotFoundAll=82;
    if ((xlMostAsyncConfigureBusload= (XLFP_MOSTASYNCCONFIGUREBUSLOAD) GetProcAddress(hxlDll,"xlMostAsyncConfigureBusload")) == NULL) NotFoundAll=83;
    if ((xlMostAsyncGenerateBusload = (XLFP_MOSTASYNCGENERATEBUSLOAD) GetProcAddress(hxlDll,"xlMostAsyncGenerateBusload")) == NULL)   NotFoundAll=84;   

    if (NotFoundAll) {
      return XL_ERROR;
    }
  }
  return XL_SUCCESS;
}

////////////////////////////////////////////////////////////////////////////

//! canUnloadLibrary()

//! Unload XL API DLL
//!
////////////////////////////////////////////////////////////////////////////

XLstatus xlUnloadLibrary(void){  
  if (hxlDll) {
    FreeLibrary( hxlDll );
    hxlDll = 0;
  }
  return XL_SUCCESS;
}

////////////////////////////////////////////////////////////////////////////

//! xlOpenDriver()

//! Automatically loads DLL and then opens driver
//!
////////////////////////////////////////////////////////////////////////////

XLstatus xlOpenDriver(void){
  
  if (xlLoadLibrary("vxlapi")!=XL_SUCCESS) return XL_ERR_CANNOT_OPEN_DRIVER;
  return xlDllOpenDriver();
}

////////////////////////////////////////////////////////////////////////////

//! xlCloseDriver()

//! Automatically close DLL
//!
////////////////////////////////////////////////////////////////////////////

XLstatus xlCloseDriver(void){
  xlDllCloseDriver();
  return xlUnloadLibrary();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -