1
這裏是一個例子再現返回指針MSG與導出的成員函數 - DLL
// in a header from a dll
class Window{
public:
MSG _declspec(dllexport) *getMessage(); //compiles
MSG* _declspec(dllexport) getMessage(); //fails
}
定義在一個cpp文件設定。
在應用程序中,我無法訪問成員函數,爲什麼?我從一個實例訪問過程中的功能窗口,如:
Window App;
func_with_parameters(param,App.getMessage(),0,0); // not found !
對於後者的問題,一個'class'塊的默認的可見性是'private'。 – andlabs
Sry,忘記在這個問題中補充說。在代碼中,它是公開的。 –