|
From: Thomas S. <ste...@gm...> - 2008-12-05 02:22:53
|
Hello, I have a small porgram (pure c and winapi) and I need to subclass a static text control. btw: with VS2008 all is working fine and compiles. Subclassing works and all seems to be coded right. btw2: I'm linking against the comctl32 lib (see below) and using a manifest and initialize the common controls with InitCommonControls(&icc) btw3: If I compile I use this CFLAGS CFLAGS = -c -O2 -Wall -pedantic -Wno-long-long -ansi and all was fine until I implemented the subclass If I try to compile with MinGW (gcc 3.4.5) I get the error: undefined reference to _DefSubclassProc@16 :-( ---snip--- "C:/pro/mingw3/bin/gcc.exe" -mwindows -s int/main.o int/main.res -o bin/main. exe -L"C:/pro/mingw3/lib/gcc/mingw32/3.4.5" -L"C:/pro/mingw3/lib" -L"./lib" -L". " -lshell32 -lshlwapi -ladvapi32 -lcomctl32 int/main.o:main.c:(.text+0xd0f): undefined reference to `_DefSubclassProc@16' collect2: ld returned 1 exit status make: *** [bin/main.exe] Error 1 ---snap--- If I subclass the static control I must use this function [...] return DefSubclassProc(hWnd, uMsg, wParam, lParam); [...] at the end of the "OwnerDrawnStaticTextControl" Callback funtion. When I look in commctrl.h I find the definition 3048 LRESULT WINAPI DefSubclassProc(HWND,UINT,WPARAM,LPARAM); if I comment out in my source: /*return DefSubclassProc(hWnd, uMsg, wParam, lParam);*/ the program compiles well, but it laks the subclassed dialog item, but shows me the other common Controls are initilized well. How can I fix this? Hope that someone can help me. Thomas |