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. [SOLVED]Qt + COM (ActiveX)
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Qt + COM (ActiveX)

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.3k Views 1 Watching
  • 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.
  • _ Offline
    _ Offline
    _KUL
    wrote on last edited by
    #1

    Sorry for the rubbish, really want to attract the attention of people in the know!
    Please, if someone has worked with QAxObject and understand this topic, please pay attention to the topic
    http://qt-project.org/forums/viewthread/29235/

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stukdev
      wrote on last edited by
      #2

      Maybe rewrite all in English...

      1 Reply Last reply
      0
      • _ Offline
        _ Offline
        _KUL
        wrote on last edited by
        #3

        There V82.COMConnector COM module is a module connected to the server COM 1C (the accounting system)

        For example, you can connect via PowerShell
        @$connector = New-Object -ComObject “V82.ComConnector”
        $connection = $connector.Connect("Srvr=""server1C"";Ref=""DB"";Usr=""user"";Pwd=""password"";")
        $users = Get-Property -comObj $connection -prName “UsersINdatabase1C”@

        Now, in the variable $users stored database users 1C
        $Connector can be used to obtain other information from the database 1C

        How to connect to a COM object through Qt?

        If you write code
        @#include <QApplication>
        #include <QWidget>
        #include <oleidl.h>
        #include <ActiveQt/QAxObject>
        #include <QAxWidget>
        #include <iostream>
        #include <QDebug>
        #include <clocale>
        #include <QTextCodec>

        int main(int argc, char *argv[])
        {
        QCoreApplication a(argc, argv);
        setlocale(LC_ALL, "rus");
        HRESULT r = OleInitialize(0);
        QAxObject * ax = new QAxObject("V82.COMConnector");
        QAxObject * ac = ax->querySubObject("Connect("Srvr=172.0.0.100;Ref=jkh02;Usr=1C-Bot;Pwd=qaz;")");
        return a.exec();
        }@

        Will get an error
        @ QAxBase: Error calling IDispatch member Connect: Exception thrown by server

                     Code       : 16389
                     Source     : V82.COMConnector.1
                     Description: {????????????????????????(36&#41;}: ???????????? : 1C-Qt-B
        ot-vostok ?? ??? ?????? ? ??????????? ?????????????. ???????? ?????? ??? ???????
        ??? ???????????? ? ??????????.
         
        {???????????.????????????????????????.??????(172)}: ?????? ??? ?????? ?????? ???
        ?????? (????????): ?????? ??? ?????????? ??????????? - '????????????': {????????
        ???.????_???????????.??????(186)}: ?????? ??? ????????? ???????? ???????? ??????
        ??? (?????????????????????????????????????): ??????? ????????? ?????????????????
        ???? ???????? ????????? ??????
                    Help       :
                Connect to the exception(int,QString,QString,QString) signal to catch this exception@
        

        Question - why? Why error occurs when creating a variable *ac?

        Sorry for the translation, it is to blame Google :)

        1 Reply Last reply
        0
        • _ Offline
          _ Offline
          _KUL
          wrote on last edited by
          #4

          Оказалось, что коннект я правильно делаю и соединение успешно, просто моего пользователя не было в справочнике пользователей в базе 1С, поэтому и не пускал :)

          It turned out that I'm doing this right connection and the connection is successful, just my user was not in the directory of users in the 1C, and therefore would not allow him :)

          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