CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Join Date
    Nov 2005
    Posts
    102

    Re: calling function in dll not working

    A lib file would be easier, but in my case i really need a dll.
    When i used dumpbin on my dll it gave me the following output:

    dumpbin \EXPORTS path\to\file.dll
    File Type: DLL

    Summary

    1000 .data
    1000 .idata
    2000 .rdata
    1000 .reloc
    1000 .rsrc
    4000 .text
    10000 .textbss

  2. #17
    Join Date
    Nov 2005
    Posts
    102

    Re: calling function in dll not working

    Got it fixed. I had to use declspec(export). This is how it looks right now:

    Code:
    extern "C" __declspec(dllexport) int testfunc ( int x );
    
    ..
    ..
    
    int testfunc (int x)
    {
    	MessageBoxW ( NULL, L"test", L"blaat", MB_OK );
    	return x;
    }
    Thanks alot guys for your help!

  3. #18
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: calling function in dll not working

    A lib file would be easier, but in my case i really need a dll.
    You know, when you build a dll with export, the lib file is created as well. The one is called DLL's import library. Just search around for simple dll samples.
    Best regards,
    Igor

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured