2010-05-01 97 views

回答

2

你需要使用一個蹦牀功能,例如:

extern "C" gboolean trampoline(gpointer data) { 
    static_cast<MyClass*>(data)->mem_fun(); 
} 

// ... 
MyClass c = /* ... */; 
g_timeout_add(/*...*/, static_cast<gpointer>(&c)); 

this question上,如果你想寫可以移植的代碼,爲什麼你應該使用免費的功能。

相關問題