Results 1 to 8 of 8

Thread: Qt function call in vb.net

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Default Re: Qt function call in vb.net

    Hi

    I have taken the following code from a webpage and tried to test the call.

    Global header file:
    Qt Code:
    1. #ifndef QTENGINEDLL_GLOBAL_H
    2. #define QTENGINEDLL_GLOBAL_H
    3.  
    4. #include <QtCore/QtGlobal>
    5.  
    6. #if defined(QTENGINEDLL_LIBRARY)
    7. # define QTENGINEDLLSHARED_EXPORT Q_DECL_EXPORT
    8. #else
    9. # define QTENGINEDLLSHARED_EXPORT Q_DECL_IMPORT
    10. #endif
    11.  
    12. #endif // QTENGINEDLL_GLOBAL_H
    To copy to clipboard, switch view to plain text mode 

    QtEngineDll.h

    Qt Code:
    1. #ifndef QTENGINEDLL_H
    2. #define QTENGINEDLL_H
    3.  
    4. #include "qtenginedll_global.h"
    5.  
    6. class QTENGINEDLLSHARED_EXPORT QtEngineDll {
    7. public:
    8. QtEngineDll();
    9. int randInt();
    10.  
    11. };
    12.  
    13. #endif // QTENGINEDLL_H
    To copy to clipboard, switch view to plain text mode 

    QtEngineDll.cpp

    Qt Code:
    1. #include <QTime>
    2. #include "qtenginedll.h"
    3.  
    4.  
    5. QtEngineDll::QtEngineDll()
    6. {
    7. //Create random number seed
    8. QTime time = QTime::currentTime();
    9. qsrand((uint)time.msec());
    10. }
    11.  
    12. int QtEngineDll::randInt()
    13. {
    14. // Random number between low and high
    15. //return qrand() % ((aHigh + 1) - aLow) + aLow;
    16. return 0;
    17. }
    To copy to clipboard, switch view to plain text mode 

    Now while calling from Vb .net I am using the following command:

    Qt Code:
    1. <DllImport("G:\Varen_CS\02_Projects\01_Softwares\highFreqTrad\QtDLLImport\test\test\debug\test.dll", _
    2. CallingConvention:=CallingConvention.StdCall)> _
    3. Private Shared Function QtEngineDll() As Integer
    4. End Function
    To copy to clipboard, switch view to plain text mode 


    It is giving me the error: Unable to find an entry point named 'QtEngineDll' in DLL

    Can you pls tell me what the wrong I am do'g and what is the entry point to be used from the code?
    Also how should I define a different entry point in a dll?
    Is it possible to define multiple entry points in a single dll?


    Thanks in advance.

  2. #2
    Join Date
    Feb 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Default Re: Qt function call in vb.net

    Ok I got it.

    But now I am facing a new problem. I am passing a string value as an argument. But It is reading its ascii value.

Similar Threads

  1. Replies: 1
    Last Post: 7th October 2009, 20:37
  2. Call to database function.
    By retto in forum Qt Programming
    Replies: 1
    Last Post: 14th September 2009, 12:29
  3. function call
    By Walsi in forum Qt Programming
    Replies: 3
    Last Post: 12th June 2007, 09:13
  4. Cannot call function without object
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 11th June 2007, 14:55
  5. performance - call function
    By mickey in forum General Programming
    Replies: 8
    Last Post: 28th February 2007, 18:29

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.