Results 1 to 1 of 1

Thread: Dll Import with entry point

  1. #1
    Join Date
    Nov 2014
    Posts
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Dll Import with entry point

    Heyy,

    i know that using google.de helps with many problems. Unfortunately i am not able to get this one solved:

    I have a .dll and a C# source File, nothing else.

    My problem is that i can't transform the C# code in an executable

    Following is the C# Code:
    Qt Code:
    1. [DllImport("SomeonesApi.dll", EntryPoint="RegisterUser")]
    2. public static extern uint RegisterMe(
    3. byte hUsernumber, // Requested Usernumber (in hex)
    4. string Username); // Name of the user
    To copy to clipboard, switch view to plain text mode 

    The solution i've seen is via QLibrary.

    Qt Code:
    1. QLibrary lib("C:/Windows/system32/SomeonesApi.dll");
    2. lib.load();
    3. bool successfully_loaded =lib.isLoaded();
    4. typedef unsigned int (*RegisterMe) (unsigned char,std::string);
    5. RegisterMe newUser = new RegisterMe(0x01,"User1");
    6. RegisterMe returnvalue = (newUser )lib.resolve("RegisterUser");
    To copy to clipboard, switch view to plain text mode 

    Can someone tell me what i've done wrong? Is there another (better) way to get this c# function transformed?

    Thanks in advance


    Added after 1 16 minutes:


    I think i got it working ... :
    Qt Code:
    1. QLibrary lib("C:/Windows/system32/SomeonesApi.dll");
    2. lib.load();
    3. bool successfully_loaded =lib.isLoaded();
    4. typedef unsigned int (*RegisterMe) (unsigned char,std::string);
    5. //RegisterMe newUser = new RegisterMe(0x01,"User1"); this line was the wrong one
    6. RegisterMe newUser = (RegisterMe )lib.resolve("RegisterUser");
    7. if (newUser)
    8. {
    9. newUser(0x01,"User1");
    10. return 0;
    11. }
    12. else return -1;
    To copy to clipboard, switch view to plain text mode 

    If anyone else has a better solution:

    Feel free to write
    Last edited by Mito0602; 4th November 2014 at 12:23.

Similar Threads

  1. Missing entry point from dll
    By Delphi in forum Newbie
    Replies: 2
    Last Post: 17th July 2013, 07:43
  2. How to get Entry-point of an executable?
    By elmasmalo1 in forum Installation and Deployment
    Replies: 1
    Last Post: 13th April 2013, 17:54
  3. Entry point not found
    By feraudyh in forum Installation and Deployment
    Replies: 3
    Last Post: 2nd July 2010, 12:12
  4. Procedure entry point not located
    By Hannibal in forum Qt Programming
    Replies: 2
    Last Post: 8th October 2008, 16:13
  5. Entry point not found after compiling with Qt 4.2
    By mace in forum Installation and Deployment
    Replies: 6
    Last Post: 10th October 2006, 11:24

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.