CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    C++/CLI (calling functions in a DLL)

    As a VC++ user I'm trying to get to grips with C++/CLI. I've created a DLL with a single function:-

    Code:
    // My source file:-
    #include "ClassLibrary1.h"
    
    namespace ClassLibrary1 {
    	int Class1::MyInt()
    	{
    		return 69;
    	}
    
    }
    and my DLL compiles okay. So now that it's compiling... how do I link to the built DLL? System DLLs seem to get added as a reference assembly. So do I need to add my own DLL as a reference somehow? Or should I still do it the old fashioned way by adding it to the link libraries, like in regular VC++ (i.e. in my exe project's Properties window)?

    [Edit...] I figured out I need to add it as a reference (in fact AFAICT C++/CLI doesn't generate a .lib file for managed DLL's - so they can't be added in the conventional way, like unmanaged link libraries).
    Last edited by John E; October 30th, 2019 at 04:58 AM.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

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