Are you sure that __stdcall is right? Thats normally only used for system dlls. For writing an own DLL I would use __cdecl, not __stdcall.