linker problem
Posted: Tue Apr 27, 2004 9:10 pm
i get an error message when i try to use a library i made with tailbite. it says "likner error: undefined reference to TB/temp dockwindow_lib mywindowproc"
anyone know why it is doing this. my source above is the source to my lib. thanks.
Code: Select all
Global Dock.TB_GadgetVT
Structure dockwindow
parenthandle.l
x.l
y.l
Width.l
Height.l
Caption.s
EndStructure
Procedure MyWindowProc(parenthandle,msg,wParam,lParam)
Select msg
Case #WM_LBUTTONDOWN
SendMessage_(parenthandle,#WM_PARENTNOTIFY,wParam,lParam)
EndSelect
ProcedureReturn DefWindowProc_(parenthandle,msg,wParam,lParam)
EndProcedure
ProcedureDLL createdockedwindow(parenthandle,x,y,Width,Height,Title$); Create a window in a "Docked" state
ClassName.s = "Dockwindow"
wc.WNDCLASSEX
wc\cbSize = SizeOf(WNDCLASSEX)
wc\style = #CS_HREDRAW | #CS_VREDRAW | #CS_GLOBALCLASS
wc\lpfnWndProc = @MyWindowProc()
wc\cbClsExtra = 0
wc\cbWndExtra = 0
wc\hInstance = GetModuleHandle_(0)
wc\hIcon = 0
wc\hbrBackground = GetStockObject_(#LTGRAY_BRUSH);#WHITE_BRUSH);
wc\lpszMenuName = 0
wc\lpszClassName = @ClassName
wc\hIconSm = 0
If RegisterClassEx_(@wc)
Else
MessageRequester("","Failed to register the window class...",0)
End
EndIf
hInstance.l = GetModuleHandle_(0)
hwnd = CreateWindowEx_(#WS_EX_TOOLWINDOW,"Dockwindow",Title$,#WS_EX_WINDOWEDGE|#WS_CHILD|#WS_EX_CLIENTEDGE|#WS_POPUPWINDOW|#WS_VISIBLE,x,y,Width,Height,0,0,GetModuleHandle_(0),0)
Brush.LOGBRUSH\lbColor = GetSysColor_(#COLOR_BTNFACE)
SetClassLong_(hwnd, #GCL_HBRBACKGROUND, CreateBrushIndirect_(Brush))
RedrawWindow_(hwnd,0,0,7)
SetParent_(hwnd,parenthandle)
SetWindowLong_( hwnd,#GWL_STYLE, #WS_DLGFRAME|#WS_CLIPCHILDREN|#WS_CLIPSIBLINGS )
ShowWindow_(hwnd,#SW_SHOW)
MoveWindow_(hwnd,x,y,Width,Height, #True )
ProcedureReturn hwnd
EndProcedure
ProcedureDLL dock_window(dockhandle,parenthandle,x,y,Width,Height);Docks Your Window and Makes it Immobile
Brush.LOGBRUSH\lbColor = GetSysColor_(#COLOR_BTNFACE)
RedrawWindow_(dockhandle,0,0,7)
SetParent_(dockhandle,parenthandle) ;DOESNT WORK
SetWindowLong_( dockhandle,#GWL_STYLE, #WS_DLGFRAME|#WS_CLIPCHILDREN|#WS_CLIPSIBLINGS )
ShowWindow_(dockhandle,#SW_SHOW)
MoveWindow_(dockhandle,x,y,Width,Height, #True )
EndProcedure
ProcedureDLL closedockwindow(dockwindownumber); Close a Dockwindow
DestroyWindow_(dockwindownumber)
EndProcedure
ProcedureDLL undockwindow(dockhandle,x,y,Width,Height);Undocks Your Window and Makes it a Free Toolwindow
ShowWindow_(dockhandle,#SW_HIDE)
SetWindowLong_(dockhandle,#GWL_STYLE,#WS_BORDER|#WS_CAPTION|#WS_DLGFRAME|#WS_CLIPCHILDREN|#WS_CLIPSIBLINGS )
RedrawWindow_(dockhandle,0,0,7)
MoveWindow_(dockhandle,x,y,Width,Height, #True )
RedrawWindow_(dockhandle,0,0,7)
SetParent_(dockhandle,#NULL)
ShowWindow_(dockhandle,#SW_SHOW)
EndProcedure
ProcedureDLL undockToMDI(dockhandle,MDIGadget,newMDIx,newMDIy,newMDIWidth,newMDIHeight);Undocks Your Window and sets its parent to a local MDIgadget
ShowWindow_(dockhandle,#SW_HIDE)
leftoffset=GetSystemMetrics_(#SM_CXMIN)
SetWindowLong_(dockhandle,#GWL_STYLE,#WS_BORDER|#WS_CAPTION|#WS_DLGFRAME|#WS_CLIPCHILDREN|#WS_CLIPSIBLINGS )
MoveWindow_(dockhandle,0,0,leftoffset,newMDIHeight-20, #True )
ResizeGadget(MDIGadget,newMDIx,newMDIy,newMDIWidth, newMDIHeight)
SetParent_(dockhandle,GadgetID(MDIGadget))
RedrawWindow_(dockhandle,0,0,7)
ShowWindow_(dockhandle,#SW_SHOW)
EndProcedure
ProcedureDLL dynamicRelease(dockhandle,MDIGadget);undocks the window and automatically resizes the MDI Gadget to the MDI width + the width of the dockwindow
EndProcedure
ProcedureDLL dynamicDock(dockhandle,MDIGadget);docks the window and automatically resizes the MDI Gadget to the MDI width - the width of the dockwindow
EndProcedure
ProcedureDLL getDockstate(dockhandle);returns a dockwindow state
ProcedureReturn dockstate
EndProcedure
ProcedureDLL flipDockstate(dockhandle,parenthandle);flips a dockwindow state to the opposite
dockstate =GetWindowLong_(dockhandle,#GWL_HWNDPARENT)
If dockstate=parenthandle
SetActiveWindow_(dockhandle)
x=WindowX()
y=WindowY()
SetWindowLong_(dockhandle,#GWL_STYLE,#WS_BORDER|#WS_CAPTION|#WS_DLGFRAME|#WS_CLIPCHILDREN|#WS_CLIPSIBLINGS )
RedrawWindow_(dockhandle,0,0,7)
SetWindowPos_(dockhandle,0,x,y,0,0,#SWP_NOSIZE)
SetParent_(dockhandle,#NULL)
ShowWindow_(dockhandle,#SW_SHOW)
Else
ShowWindow_(dockhandle,#SW_HIDE)
SetWindowLong_( dockhandle,#GWL_STYLE, #WS_DLGFRAME|#WS_CLIPCHILDREN|#WS_CLIPSIBLINGS )
RedrawWindow_(dockhandle,0,0,7)
SetWindowPos_(dockhandle,0,x,y,0,0,#SWP_NOSIZE)
SetParent_(dockhandle,parenthandle)
ShowWindow_(dockhandle,#SW_SHOW)
EndIf
EndProcedure