Results 1 to 4 of 4

Thread: Visual Studio 2008 - Creating DLL

  1. #1
    Join Date
    Jan 2009
    Posts
    76

    Visual Studio 2008 - Creating DLL

    hi,
    I have insatlled Visual Studio 2008.How can i create DLL in Project type Visual C++.Since I have not much worked with VS2008, I would be grateful for help

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Visual Studio 2008 - Creating DLL

    Steps to Create Your DLL

    • Create a Win32 Dynamic Link Library project, adding a *. cpp and a *. h file.
    • In the *. cpp file, create a class instantiated from the CWinApp file.
    • In the *. h file (here it is SourceFile.h), define the functions to be used. Also specify the dllexport value for the _declspec function.
    • Then compile the DLL.
    • Create a normal Win32 Application with a *. cpp file and a *. h file.
    • In the *. h file, (here it is AppHeader.h), declare the function with the dllimport value of _declspec


    In the *. cpp file, use the function.

    Code:
    # Include "AFXWIN.H" 
      # Include "AppHeader.h" 
    
      class MainFrame: public CFrameWnd 
      ( 
          public: 
    
              Mainframe () 
              ( 
                  CreateProcess (0, "Trial"); 
              ) 
    
              OnLButtonDown void (UINT nFlags, CPoint point) 
              ( 
                  int res; 
                  char str [5]; 
                  res = Calc (998, 226); 
                  sprintf (str, "% d", res); 
                  MessageBox (str); 
               ) 
    
               DECLARE_MESSAGE_MAP () 
      );
    In the Link tab of the "Project-> Settings" dialog, go to the text box labeled "Object / Library Modules" and specify the path of the DLL file. Then copy the compiled DLL file to your current appliation path directory and run the program.

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Visual Studio 2008 - Creating DLL

    If you want to create a "managed" (i.e. CLR-based) DLL to be used from C#, I think that you should choose "Class Library" (under Visual C++ / CLR node in the "Project types" tree). This class library will export "managed" (CLR-based) classes, i.e. it will have an object-oriented structure (with classes, methods, etc.)
    You can create these classes using C++/CLI extensions to C++ language, and you can use these classes in other .NET languages, including C# and VB.NET.

  4. #4
    Join Date
    Jan 2009
    Posts
    318

    Re: Visual Studio 2008 - Creating DLL

    I had a similar project on the page seen, but this looks promising. Thanks you.

Similar Threads

  1. Replies: 2
    Last Post: 16-02-2011, 02:49 PM
  2. Difference between Visual studio 2005 and Visual studio 2008
    By RohanS in forum Software Development
    Replies: 3
    Last Post: 12-06-2009, 10:48 AM
  3. Creating portable executable with Visual Studio
    By KaramChand in forum Software Development
    Replies: 3
    Last Post: 04-02-2009, 07:30 PM
  4. What is Visual Studio 2008
    By Jackie in forum Software Development
    Replies: 1
    Last Post: 23-12-2008, 05:31 PM

Tags for this Thread

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
  •  
Page generated in 1,713,520,922.96325 seconds with 17 queries