Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-03-2009
Member
 
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
Reply With Quote
  #2  
Old 26-03-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
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.
Reply With Quote
  #3  
Old 26-03-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
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.
Reply With Quote
  #4  
Old 26-03-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Visual Studio 2008 - Creating DLL"
Thread Thread Starter Forum Replies Last Post
Visual Studio 2010: features and changes compared to Visual Studio 2008 BinDs14 Guides & Tutorials 2 16-02-2011 02:49 PM
Difference between Visual studio 2005 and Visual studio 2008 RohanS Software Development 3 12-06-2009 10:48 AM
Creating portable executable with Visual Studio KaramChand Software Development 3 04-02-2009 07:30 PM
What is Visual Studio 2008 Jackie Software Development 1 23-12-2008 05:31 PM


All times are GMT +5.5. The time now is 12:56 AM.