- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get an error message as follows:
error LNK2019: unresolved external symbol _ONOWNERDRAW referenced in function _newdlgproc
Here is the relevant code extract:
INTEGER*4 FUNCTION NewDlgProc(hWnd, mesg, wParam, lParam)
!DEC$ATTRIBUTES STDCALL:: NewDlgProc
!
use dfwin
USE DFLIB
USE OwnerDrawGlobals
!
IMPLICIT NONE
INTEGER*4 hWnd, mesg,lParam, wParam
integer*4 retint
!
INCLUDE 'RESOURCE.FD'
!
Interface
SUBROUTINE OnOwnerDraw(hWnd,ID,hDC)
!DEC$ ATTRIBUTES, STDCALL : : OnOwnerDraw
use DFWINTY
integer(HANDLE) :: hWnd, hDC
integer(DWORD) :: ID
end Subroutine
end interface
...
...
CALL OnOwnerDraw(getdlgItem(hWnd,IDC_OWNER),IDC_OWNER, Itemstruc%Hdc)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the source file with
CALL OnOwnerDraw( .....)
You need the INTERFACE copied or included somehow. each source file with calls to OnOwnerDraw needs to know it's STDCALL, otherwise you'll get the wrong ABI for the call and the link step will fail. Names for STDCALL procedures are decorated differently.
Easiest to put OnOwnerDraw into a MODULE and USE the module where you call OnOwnerDraw
To elaborate: if the call is in a subroutine or function:
subroutine foo
...
call OnOwnerDraw(...)
end subroutine
you need to put the interface inside subroutine FOO. It does not 'inherit' it from the source file above by magic.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page