Your function should be declared something like this
code:
int WINAPI sum (int n1, int n2)
{
return n1+n2;
}
Do not use any form of C++ style dll exporting ( DECLSPEC_EXPORT ) as this is for C++ only. If you want to use the function in VB, the function needs to be exported by name only.
in your def file, you should have something like
code:
LIBRARY "functions"
DESCRIPTION "Some description here"
EXPORTS
;Explicit exports go here
sum
If this still doesn't work, make sure that your def file has the same name as the project.