By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,470 Members | 924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,470 IT Pros & Developers. It's quick & easy.

how to make dll??

P: 1
hi..
i want to know how to make a dll, link c++ and matlab..
tq
Aug 5 '07 #1
Share this Question
Share on Google+
1 Reply


100+
P: 114
hi..
i want to know how to make a dll, link c++ and matlab..
tq
If you are using the Visual C++ Compiler, select the Win32 Dynamic Link Library Project option.
Then Select "Create a Simple DLL project"

There will be some WinMain Code included.

After that you put the functions you want to put in.

Example:
Expand|Select|Wrap|Line Numbers
  1. // DLL.cpp : Defines the entry point for the DLL application.
  2. //
  3.  
  4. #include "stdafx.h"
  5.  
  6. BOOL APIENTRY DllMain( HANDLE hModule, 
  7.                        DWORD  ul_reason_for_call, 
  8.                        LPVOID lpReserved
  9.                      )
  10. {
  11.     return TRUE;
  12. }
  13.  
  14. //This is the code
  15.  
  16. int _stdcall sum(int x , int y)
  17. {
  18.    return x+y;
  19.  
  20.  
When you have made the .cpp file, you make a .def file.

example: This is the file TUTORIAL1.def


LIBRARY TUTORIAL1

EXPORTS

sum @ 1
Aug 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.