TWS API 9.71, VB_API_sample example does not compile

Discussion in 'Trading Software' started by ssg10, Mar 21, 2015.

  1. ssg10

    ssg10

    Hi,

    I tried to build the VB.net example straight from TWS_API/samples/TestActiveX_VB.NET
    using MS visual studio 2012 on Win7 64-bit, and it won't build with this error below. Anybody know why?

    ------ Build started: Project: VB_API_sample, Configuration: Debug x86 ------
    C:\TWS API\samples\TestActiveX_VB.NET\VB_API_sample.vb(97) : error BC30002: Type 'AxTWSLib.AxTws' is not defined.
    C:\TWS API\samples\TestActiveX_VB.NET\VB_API_sample.vb(150) : error BC30002: Type 'AxTWSLib.AxTws' is not defined.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_accountDownloadEndEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_accountSummaryEndEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_accountSummaryEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_commissionReportEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_contractDetailsEndEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_contractDetailsExEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_currentTimeEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_deltaNeutralValidationEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_displayGroupListEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_displayGroupUpdatedEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_errMsgEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_execDetailsEndEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_execDetailsExEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_fundamentalDataEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_historicalDataEnd.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_historicalDataEvent1.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_managedAccountsEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_marketDataTypeEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_nextValidIdEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_openOrderExEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_orderStatusEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_positionEvent1.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_realtimeBarEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_receiveFAEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_scannerDataEndEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_scannerDataExEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_scannerParametersEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_tickEFPEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_tickGenericEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_tickOptionComputationEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_tickPriceEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_tickSizeEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_tickSnapshotEndEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_tickStringEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_updateAccountTimeEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_updateAccountValueEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_updateMktDepthEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_updateMktDepthL2Event.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_updateNewsBulletinEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_updatePortfolioExEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_verifyCompletedEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\_DTwsEvents_verifyMessageAPIEvent.vb(4) : error BC30037: Character is not valid.
    C:\TWS API\samples\TestActiveX_VB.NET\dlgComboOrderLegs.vb(541) : warning BC42024: Unused local variable: 'insertPos'.
    C:\TWS API\samples\TestActiveX_VB.NET\dlgComboOrderLegs.vb(581) : warning BC42024: Unused local variable: 'iLoop'.
    C:\TWS API\samples\TestActiveX_VB.NET\dlgComboOrderLegs.vb(582) : warning BC42024: Unused local variable: 'Count'.
    C:\TWS API\samples\TestActiveX_VB.NET\dlgComboOrderLegs.vb(656) : warning BC42024: Unused local variable: 'insertPos'.
    C:\TWS API\samples\TestActiveX_VB.NET\dlgComboOrderLegs.vb(674) : warning BC42104: Variable 'selRowStart' is used before it has been assigned a value. A null reference exception could result at runtime.
    C:\TWS API\samples\TestActiveX_VB.NET\dlgComboOrderLegs.vb(674) : warning BC42104: Variable 'selRowEnd' is used before it has been assigned a value. A null reference exception could result at runtime.
    C:\TWS API\samples\TestActiveX_VB.NET\dlgMktDepth.vb(196) : warning BC42024: Unused local variable: 'bookentry'.
    C:\TWS API\samples\TestActiveX_VB.NET\dlgMktDepth.vb(196) : warning BC42024: Unused local variable: 'oldVal'.
    C:\TWS API\samples\TestActiveX_VB.NET\dlgMktDepth.vb(197) : warning BC42024: Unused local variable: 'theRow'.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
     
  2. Never used VB, but looks like you did not provide the required assemblies. You may have to install the API package from IB into the right path before you compile this project.

     
  3. vicirek

    vicirek

    This example is mixed assembly C# and VB. Make sure that you are opening file .sln (solution) to have both assemblies (projects) active in the editor. C# is the API part and it generates a dll that needs to be registered with Windows. That requires Visual Studio to be started as an Administrator (on my machine). Since your errors indicate that 0 succeeded and 1 failed then the C# part was not loaded into the solution I suspect. Hence the first 2 errors regarding missing library objects that are part of the C# project (it is library project and cannot be run as a stand alone app - it produces dll or is part of another app like here).

    The next 40 errors or so are caused by the editor due to some upgrade/translation issues in Visual Studio. Just double click on the error and it will take you to the line with error and hit delete once for each error. It should delete those weird characters (some are barely visible) that were added by the VS when reading files.

    After that I had another issue running it (error) but after closing VS and opening the solution again from Windows Explorer it run (this time VS was not run as Administrator).

    I tested this on Windows 10 preview with VS community 2013 installed with fresh download of TWS API 971
     
  4. ssg10

    ssg10

    Thanks! It works now.
     
  5. What was the issue?