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
Forum Update on Monday, May 27th 2025

CoCreateInstance() in Qt5.9

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 956 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.
  • L Offline
    L Offline
    Limer
    wrote on 14 Mar 2018, 00:14 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

    A 1 Reply Last reply 14 Mar 2018, 06:08
    0
    • L Limer
      14 Mar 2018, 00:14

      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

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 14 Mar 2018, 06:08 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
      • L Offline
        L Offline
        Limer
        wrote on 14 Mar 2018, 07:22 last edited by
        #3

        Success! Thanks.

        1 Reply Last reply
        0

        1/3

        14 Mar 2018, 00:14

        • Login

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