Results 1 to 8 of 8

Thread: Qt function call in vb.net

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

    Exclamation Qt function call in vb.net

    Hi

    I am building a program in VB.net and almost done with it. but I have some problem with getting http response.
    Getting http response in qt is much much faster. If I want to use the http request function of qt4 in a vb.net then how to proceed?

    I dont know whether this is possible or just an absurd idea.

    Please give your response and the possible way of combining it..

    Thanks in advance.

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt function call in vb.net

    just google 'c++ dll from vb.net' - that will give you plenty of ideas

  3. #3
    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

    Quote Originally Posted by schnitzel View Post
    just google 'c++ dll from vb.net' - that will give you plenty of ideas
    schnitzel Thanks for your reply.

    Say I have a Qt C++ code which will return a string variable say. Now I want to use this string variable in my vb.net code for further processing. Can you help me on that pls.

    Thanks in advance.

  4. #4
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt function call in vb.net

    Quote Originally Posted by abghosh View Post
    schnitzel Thanks for your reply.

    Say I have a Qt C++ code which will return a string variable say. Now I want to use this string variable in my vb.net code for further processing. Can you help me on that pls.

    Thanks in advance.
    see if this helps: http://www.codeproject.com/KB/dotnet/c_dll_in_vb.aspx

  5. #5
    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

    Quote Originally Posted by schnitzel View Post
    Hi schnitzel

    A lot thanks for your help.
    Now I would like to ask you one more question. May be silly...

    How can I make DLL file from a qt project?

  6. #6
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt function call in vb.net

    Quote Originally Posted by abghosh View Post
    Hi schnitzel

    A lot thanks for your help.
    Now I would like to ask you one more question. May be silly...

    How can I make DLL file from a qt project?
    It isn't a silly question but it doesn't belong here.
    Btw: you should learn how to read Qt Documentation.

    You should make a big bookmark to this: http://doc.qt.nokia.com/4.6/

    specific to your question:
    http://doc.qt.nokia.com/4.6/sharedlibrary.html
    Last edited by schnitzel; 3rd March 2010 at 19:12.

  7. #7
    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.

  8. #8
    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, 21:37
  2. Call to database function.
    By retto in forum Qt Programming
    Replies: 1
    Last Post: 14th September 2009, 13:29
  3. function call
    By Walsi in forum Qt Programming
    Replies: 3
    Last Post: 12th June 2007, 10:13
  4. Cannot call function without object
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 11th June 2007, 15:55
  5. performance - call function
    By mickey in forum General Programming
    Replies: 8
    Last Post: 28th February 2007, 19: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.