Hello World To DLL

I would like to see a video or set of instructions to the EASIEST DLL using program anyone can make (for Windows). I found this one video on youtube, but I didn't understand 1/4 of it. Thanks
Sorry to bump but I still have not found anything helpful :(
Do you mean that you have a DLL and you want to make a program that uses functions from this DLL?

Also, give us a link to the youtube video so we have a better idea of what you are trying to do.
Hi,
I am assuming that you want to create a DLL as well as a file to use it.

Below is a bare bones example of the two.


SimpleDLL.cpp

1
2
3
4
5
6
int		__declspec(dllexport)	add(int val1,int val2);

int	add(int val1,int val2)
{
	return(val1 + val2);
}


SimpleTest.cpp

1
2
3
4
5
6
7
8
9
10
11
12
#include	<stdio.h>

int	__declspec(dllimport)	add(int val1,int val2);

int	main(int argc,char** argv)
{
	int		v1 = 2;
	int		v2 = 3;
	int		res = add(v1,v2);

	printf("%d + %d = %d",v1,v2,res);
}


Hope this helps
Shredded
Topic archived. No new replies allowed.