SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2010
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C#: Can't see methods in DLL... why?

    I developed a DLL in C#

    When I am trying to call it I get:

    System.EntryPointNotFoundException: Unable to find an entry point named:

    It means that DLL doens't export any methods visible from DLL. Dumpbin doesn't show any methods either:

    dumpbin.exe -exports ActiveXTest.dll
    Dump of file ActiveXTest.dll
    File Type: DLL
    Summary
    2000 .reloc
    2000 .rsrc
    2000 .text

    What's wrong????

    The DLL looks ok.. according to documentation:

    Code Csharp:
    namespace Kosmala.Michal.ActiveXTest
            public static void setHooks()
            {
            ....
            }
    Here is how I call it:
    Code Csharp:
    namespace IWFHotkeyStarter
    {
        class Program
        {
            [DllImport("D:\\work\\iwf\\_ctrl-tab-modless_dlg_testing\\activex\\VSProjects\\AcriveXSourceCode\\bin\\Debug\\ActiveXTest.dll")]
            public extern static void setHooks();
            static void Main(string[] args)
            {
                Program p = new Program();
                p.run();
            }
            private void run(){
                Console.WriteLine("run<<");
                setHooks();
                Console.WriteLine("run>>");    
            }
        }
    }

    Please help

  2. #2
    SitePoint Guru Jason__C's Avatar
    Join Date
    Oct 2009
    Location
    Racoon City
    Posts
    660
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You have "extern" below the DLL Import, might want to change it to "external".

  3. #3
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,877
    Mentioned
    46 Post(s)
    Tagged
    0 Thread(s)
    And if the dll is in C# why use a [DllImport] attribute to use it? Why not just include it in your projects bin folder?


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
  •