I have a DLL library in C (and its source code) and I'm interfacing it using python 3.9. There is one function that passes an enum as a function parameter. I defined the enum as a dll_export so I could use it in python but get an error that the enum is not defined. I was wondering if it's even possible to export enums from the DLL and use them in python. Here is a code example.
#pragma once
#include <stdio.h>
#ifdef HELLO_WORLD_EXPORTS
#define HELLO_WORLD_API __declspec(dllexport)
#else
#define HELLO_WORLD_API __declspec(dllimport)
#endif
HELLO_WORLD_API int sum(int a, int b);
HELLO_WORLD_API void message(void);
HELLO_WORLD_API typedef enum{ Mon, Tue, Wed, Thur, Fri, Sat, Sun }day;
HELLO_WORLD_API void my_test(day data);
HELLO_WORLD_API void my_test(day data)
{
printf("%d", data);
}
if I were to use the enum in C would be like in the example below.
int main()
{
day test = Sun;
my_test(test);
return 0;
}
I can use other functions from the DLL using python without problems except for the ones that have enums as parameters. I would appreciate any suggestions, thanks.