开发者

Accessing MFC functions in python

I have just recently started using python for using it with my mfc program and it has been a decent journey so far. At the moment, I am trying to access a function from my mfc dll program that has a format given below:

void DLLDIR DrawEllipse ( CRect, CDC* );

I have used extern "C" and everything and I am able to access the function. In terms of declaring its restype and arguement type, I am facing some pr开发者_Python百科oblems at the moment. Obviously the restype would be "None" but I am unable to understand as to how do I declare its arguement type which are CRect and CDC*.Would be great if someone already knows how to access the MFC functions and use them as arguements in your python functions.

Thanks in advance.


You can't, you need to wrap those structures as Python objects - either make you own, or use the 'native' Python equivalent of a rectangle (if there is one, I don't know of any). Look at Python win32 packages such as win32all to do the heavy lifting, so that you won't have to re-implement it all yourself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜