Results 1 to 2 of 2

Thread: MFC dll in Qt4

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Location
    Germany
    Posts
    35
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question MFC dll in Qt4

    hi all, i am developing a small program that use a mfc dll, i am completely new in qt;

    when i use this to call to a function in the dll works just fine:

    Qt Code:
    1. QLibrary myLib("C:\\dllfolder\\MFCDLL.dll");
    2. typedef int (*MyPrototype)(bool &con);
    3. MyPrototype QLibrary myLib("C:\\dllfolder\\MFCDLL.dll");
    4. typedef int (*MyPrototype)(bool &con);
    5. MyPrototype myFunction = (MyPrototype) myLib.resolve("dllFunctionName");= (MyPrototype) myLib.resolve("dllFunctionName");
    6. bool sw;
    7. int nResult = myFunction(sw);
    To copy to clipboard, switch view to plain text mode 

    but i would like to use something like a #include directive this is possible?, i am working with visual studio 2005 i don't want to make this every time that i need a function from the dll, i have add the MFCDLL.h file to my code but still it doesn't work, any clue?

    i get the follow error when i try to call the function directly from the dll icluding the MFCDLL.h file to the code and adding this line to dlltester.pro file


    LIBS += C:\dllfolder\MFCDLL.dll


    Error 1 error LNK2019: unresolved external symbol _dllFunctionName referenced in function "private: void __thiscall Qt_DLL_Tester:n_pushButton_2_clicked(void)" (?on_pushButton_2_clicked@Qt_DLL_Tester@@AAEXXZ) qt_dll_tester.obj

    adding something: any change that i make in the .pro file doesn't look like making changes in the program.

    please help.

    thanks

    CAFU
    Last edited by cafu; 24th September 2007 at 12:02.

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.