Have you tried /NOENTRY as a linker option in your project? I realize this option is primarily used for dll's that store only resources but it's worth a try. Essentially, it indicates that our dll will not have an entry point.
Also, does your code resemble something like this?
Code:
// File: mydll.c
// Compile: cl.exe /LD mydll.c
#include <windows.h>
#define DllExport __declspec(dllexport)
DllExport int someFunction(int i)
{
return i *2;
}
Code:
// File: mydlltest.c
// Compile cl.exe mydlltest.c
#include <windows.h>
#include <stdio.h>
typedef int (WINAPI *myfunction)();
myfunction someFunction;
int main(void)
{
HINSTANCE hLib=LoadLibrary("MyDll.dll");
if(hLib == NULL)
{
printf("Unable to load library!\n");
return - 1;
}
someFunction=(myfunction)GetProcAddress((HMODULE)hLib, "someFunction");
if((someFunction == NULL))
{
printf("Unable to load function\n.");
FreeLibrary((HMODULE)hLib);
return - 1;
}
printf("someFunction returned %d\n", someFunction(32));
FreeLibrary((HMODULE)hLib);
return 0;
}