Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. CoCreateInstance() in Qt5.9
QtWS25 Last Chance

CoCreateInstance() in Qt5.9

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 955 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • LimerL Offline
    LimerL Offline
    Limer
    wrote on last edited by
    #1

    Recently I needed to use mx-component to write/read PLC(the interface is implemented with Qt.)

    After I finish the code, it come across one error.(Qt5.9 - Kit MSVC 2017 + Windows10)

    I tried to delete the Build-..-Debug folder, but no use.

    It's a question of lib? I don't know. The whole Qt project is below here, it's a tiny project.

    CoCreateInstance() is located in file plc_widget.cpp - line 49.

    Please note that I include the mx-component files in project, and the files is located in my own local PC, so if you run it directly,...will get more than one error.

    https://pan.baidu.com/s/1ciNTfzrYs9e4o5vDu3v_cw

    aha_1980A 1 Reply Last reply
    0
    • LimerL Limer

      Recently I needed to use mx-component to write/read PLC(the interface is implemented with Qt.)

      After I finish the code, it come across one error.(Qt5.9 - Kit MSVC 2017 + Windows10)

      I tried to delete the Build-..-Debug folder, but no use.

      It's a question of lib? I don't know. The whole Qt project is below here, it's a tiny project.

      CoCreateInstance() is located in file plc_widget.cpp - line 49.

      Please note that I include the mx-component files in project, and the files is located in my own local PC, so if you run it directly,...will get more than one error.

      https://pan.baidu.com/s/1ciNTfzrYs9e4o5vDu3v_cw

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by aha_1980
      #2

      hi @Limer,

      it's a linker error, so either you don't link against the lib containing this symbol or the linker cannot find the lib file.

      edit: it's ole32.lib, try adding LIBS += ole32 to your .pro file

      Qt has to stay free or it will die.

      1 Reply Last reply
      3
      • LimerL Offline
        LimerL Offline
        Limer
        wrote on last edited by
        #3

        Success! Thanks.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved