create win32 dll with multiple export functions
Jan <[email protected]> Sat, 24 Sep 2011 17:28:37 +0000 (UTC)
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
Hello,
Could someone please tell me, if it is possible to create classic win32 dll=
with
multiple export functions with Pyrex? From what I have read, I understand t=
hat
__declspec(dllexport) directive is declared for the main function only. I n=
eed
to bind that dll to language called unrealscript, where you could bind win32
dll's. Here is a sample from unrealscript documentation of how thee dll sho=
uld
be written in C.
extern "C"
{
struct FVector
{
float x,y,z;
};
__declspec(dllexport) void CallDLL1(wchar_t* s)
{
MessageBox(0, s, L"Inside the DLL: CallDLL1", MB_OK);
// reverse the out parameter string
int len =3D wcslen(s);
for(int i=3D0; i<len>>1;i++)
{
wchar_t temp =3D s[i];
s[i] =3D s[len-i-1];
s[len-i-1] =3D temp;
}
}
__declspec(dllexport) FVector* CallDLL2(float x, float y, float z)
{
static FVector result; // declared static so that the struct's memory is st=
ill
valid after the function returns.
result.x =3D x;
result.y =3D y;
result.z =3D z;
return &result;
}
thank you for help.....Jan