2010-05-01 4 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를 참조하십시오, 예컨대 : 트램 폴린 기능을 사용해야합니다.

관련 문제