- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
iret = SetClassLong(ghWndView,GCL_HCURSOR,LoadCursor(NULL,IDC_CROSS))
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
iret = SetClassLong(ghWndView,GCL_HCURSOR,LoadCursor(NULL,IDC_CROSS))
Why not use SetCursor, sure looks simpler (I have no idea if this fails in x64):
rval = SetCursor (LoadCursor(NULL, IDC_ARROW))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve, Here is an example of the warning, this time for the background brush for the window. I get similar warnings for loading the cursor. I think the final argument in SetClassLong is 32-bit but in 64-bit OS functions like LoadCursor and GetStockObject will return a 64 bit value. I could cast the function using int(function,DWORD) but I don't think it will return the correct value always.
iret
= SelectObject(hBkDC,GetStockObject(DC_BRUSH))
icolref
= SetDCBrushColor(hBkDC,RGB(int1(255*gp%BkRGB(1)),int1(255*gp%BkRGB(2)),int1(255*gp%RGB(3))))
iret
= SetClassLong(ghWndView,GCL_HBRBACKGROUND,GetStockObject(DC_BRUSH))
C:WinFEM2000menuupdate.f90(716): warning #6075: The data type of the actual argument does not match the definition. [GETSTOCKOBJECT]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, I've already tried this (see initial post)but the function could not be resolved by the linker. Where is it defined?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[plain]FUNCTION SetClassLongPtr_( & hWnd, & nIndex, & dwNewLong) use ifwinty integer(ULONG_PTR) :: SetClassLongPtr_ !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetClassLongPtrA' :: SetClassLongPtr_ integer(HANDLE) hWnd ! HWND hWnd integer(SINT) nIndex ! int nIndex integer(LONG_PTR) dwNewLong ! LONG dwNewLong END FUNCTION END INTERFACE[/plain]Note that I added an underscore at the end so as to not conflict with the real definition when it appears
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[plain]FUNCTION SetClassLongPtr_( & hWnd, & nIndex, & dwNewLong) use ifwinty integer(ULONG_PTR) :: SetClassLongPtr_ !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetClassLongPtrA' :: SetClassLongPtr_ integer(HANDLE) hWnd ! HWND hWnd integer(SINT) nIndex ! int nIndex integer(LONG_PTR) dwNewLong ! LONG dwNewLong END FUNCTION END INTERFACE[/plain]Note that I added an underscore at the end so as to not conflict with the real definition when it appears
Thanks Steve, it builds and links ok now but I can't test it until Monday. When will 11.1 be released?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page