[Pyrex] create win32 dll with multiple export functions

Jan hula21 at seznam.cz
Sat Sep 24 19:28:37 CEST 2011


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 that
__declspec(dllexport) directive is declared for the main function only. I need
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 should
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 = wcslen(s);
for(int i=0; i<len>>1;i++)
{
wchar_t temp = s[i];
s[i] = s[len-i-1];
s[len-i-1] = temp;
}
}

__declspec(dllexport) FVector* CallDLL2(float x, float y, float z)
{
static FVector result; // declared static so that the struct's memory is still
valid after the function returns.
result.x = x;
result.y = y;
result.z = z;
return &result;
}

thank you for help.....Jan




More information about the Pyrex mailing list