I am developing a programming language, and I want it to be able to access dll (or shared libs). I know that python has a `CDLL` function to do this. In C, I know that to call a dll function, you must load the library using `LoadLibrary`, and get the procedure using `GetProcAddress`, and finally cast it into a function.

```

typedef void (__stdcall *testf)();

HINSTANCE lib = LoadLibrary("test.dll");
testf proc = (testf) GetProcAddress(lib, "testf");
proc();

```

But in python, the third step is not done.

```
from ctypes import *

lib = CDLL("test.dll")
lib.testf() #not casting the function anywhere

```

How is this done, and how can I achieve the same thing in C?