I have tried using Iczelion's dll from his No.17 tutorial (or any other dll) in a VC++ project,
but I am not able to declare the TestHello function or any other function correctly.
The following error message appears:
unresolved external symbol "int __cdecl TestHello(void)" (?TestHello@@YAHXZ)
I have included DllSkeleton.lib in the project so it should have worked.
What do I need to do to use masm dll's with VC++.
Thank you guys.
:grin:
but I am not able to declare the TestHello function or any other function correctly.
The following error message appears:
unresolved external symbol "int __cdecl TestHello(void)" (?TestHello@@YAHXZ)
I have included DllSkeleton.lib in the project so it should have worked.
What do I need to do to use masm dll's with VC++.
Thank you guys.
:grin:
There are two problems with your declaration:
1. your code is C++, so the function's symbol name (?TestHello@@YAHXZ) will use C++ name decoration. You need to declare them as C (no ++) functions to get rid of this:
extern "C"
{
... your declarations here ...
}
2. You've declared the function so that it will use the C calling convention (__cdecl by default). Unless you also specified this in your asm source, you need to declare it as STDCALL function:
int __stdcall TestHello(void);
The final declaration will be:
extern "C" int __stdcall TestHello(void);
or:
extern "C"
{
int __stdcall TestHello(void);
... optionally more declares ...
}
Thomas
1. your code is C++, so the function's symbol name (?TestHello@@YAHXZ) will use C++ name decoration. You need to declare them as C (no ++) functions to get rid of this:
extern "C"
{
... your declarations here ...
}
2. You've declared the function so that it will use the C calling convention (__cdecl by default). Unless you also specified this in your asm source, you need to declare it as STDCALL function:
int __stdcall TestHello(void);
The final declaration will be:
extern "C" int __stdcall TestHello(void);
or:
extern "C"
{
int __stdcall TestHello(void);
... optionally more declares ...
}
Thomas
Thanks it works great.
:) :grin:
:) :grin: