如何将对象作为参数传递给dll
问题描述:
我需要将包含数据的对象传递给dll方法.在单独的Visual Studio解决方案文件中,对象与DLL是分开的.怎么可能?
I need to pass an object containing data to a dll method. the object is separate from the DLL, in a separate visual studio solution file. How is it possible?
我传递对象的原因是,因为我不想在DLL类库中的方法定义中单独列出所有对象属性作为参数.
The reason I am passing object is , because I don't want to list all object attributes as parameters individually in the method definition within the dll class library.
请帮助我
谢谢!
答
您可以使用结构.许多Windows API都希望使用POINT,RECT,OPENFILENAME和LOGFONT之类的结构.
You can use structures. A lot of Windows APIs expect structures such as POINT, RECT, OPENFILENAME and LOGFONT.