I have created Dll project. I created myasm.asm file that has one function:
.486
.model flat, stdcall
.code
MyProc1 proc x: DWORD, y: DWORD
xor eax,eax
//......//
ret
MyProc1 endp
end
There is my heade file:
#pragma once
#include <Windows.h>
#ifdef LAB1DLL_EXPORTS
#define LAB1DLL_API __declspec(dllexport)
#else
#define LAB1DLL_API __declspec(dllimport)
#endif
extern "C"
{
LAB1DLL_API int _stdcall MyProc1(DWORD x, DWORD y);
}
And dllMain (beging of it)"
#define LAB1DLL_EXPORTS 1
#include "Lab1Dll.h"
Im my test application in wich I want to use that dll and it's exported function I have:
#include "Lab1Dll.h"
But my dll is not exporting my MyProc1 function. If I add "normal" function to that DLL and exprot it it is avilable in my Test application and DLL compilation process produces lib file.
Without "normal" functions I don't get .lib file. And I can't link to that library.
How to make that exported function work? Or how to make it export in the first place?
UPDATE: I saw that adding .def file with below contens works perfect. But then. I shouldn't be doing it. That is what __declspec(dllexport) should do for me?
LIBRARY
EXPORTS
MyProc1