missing _SetClassLongPtr

missing _SetClassLongPtr

Postby cly166 » Mon Sep 27, 2010 3:46 am

Dear Antonio:

Error message as following:
Creating library FWBrow.lib and object FWBrow.exp
Fivehmx.lib(SKINS.obj) : error LNK2019: unresolved external symbol _SetClassLongPtr referenced in function _HB_FUN_BUTTONS2007

i am using FWH1008 and compiling with VS2008

Thanks and regards
CLY
cly166
 
Posts: 11
Joined: Sat Sep 25, 2010 2:36 pm

Re: missing _SetClassLongPtr

Postby Antonio Linares » Mon Sep 27, 2010 7:11 am

Please add this code to your main PRG:
Code: Select all  Expand view

#pragma BEGINDUMP

#include <windows.h>

ULONG_PTR WINAPI SetClassLongPtr( HWND hWnd, int nIndex, LONG_PTR dwNewLong )
{
   return SetClassLong( hWnd, nIndex, dwNewLong );
}

#pragma ENDDUMP
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: missing _SetClassLongPtr

Postby cly166 » Mon Sep 27, 2010 9:11 am

Dear Antonio:

Following is the message of compiling after appending provided code to FWBrow.prg
i am using FWH1008 and compiling with VS2008 through buildxm.bat

Regards
CLY

*---------------------------
Generating C source output to 'FWBrow.c'...
Done.
FWBrow.c
FWBrow.prg(415) : warning C4273: 'SetClassLongA' : inconsistent dll linkage
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include\winuser.h(8022) : see previous definition of 'SetClassLongA'
d:\fwh_1008b\samples\fwbrow.prg(417) : warning C4717: 'SetClassLongA' : recursive on all control paths, function will cause runtime stack overflow
user32.lib(USER32.dll) : warning LNK4006: _SetClassLongA@12 already defined in FWBrow.obj; second definition ignored
Creating library FWBrow.lib and object FWBrow.exp
Fivehmx.lib(SKINS.obj) : error LNK2019: unresolved external symbol _SetClassLongPtr referenced in function _HB_FUN_BUTTONS2007
FWBrow.exe : fatal error LNK1120: 1 unresolved externals
*--------------------------------------
cly166
 
Posts: 11
Joined: Sat Sep 25, 2010 2:36 pm

Re: missing _SetClassLongPtr

Postby Antonio Linares » Mon Sep 27, 2010 10:34 am

Cly,

Your compiler should provide SetClassLongPtr() so my code should not be needed.

Which flags are you using to call cl.exe ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: missing _SetClassLongPtr

Postby cly166 » Mon Sep 27, 2010 1:29 pm

Dear Antonio:
Compile commands as followings(modified from buildxm.bat).
Regards
CLY
*----------------------------------------
if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

ECHO Compiling...

set hdir=D:\xHB_CVSe.D
set vcdir=C:\Program Files (x86)\Microsoft Visual Studio 9.0\vc
set __include=%include%
set include="%vcdir%"\include;%hdir%\include;%__include%
set __lib=%lib%
set lib="%vcdir%"\lib;%hdir%\lib;%__lib%

%hdir%\bin\harbour %1 /n /i..\include;%hdir%\include /w /p %2 %3 > clip.log
IF ERRORLEVEL 1 PAUSE
IF ERRORLEVEL 1 GOTO EXIT

"%vcdir%"\bin\cl -TP -W3 -c /GA %1.c >> clip.log
:ENDCOMPILE

IF EXIST %1.rc "%vcdir%"\bin\rc -r -d__FLAT__ %1 >> clip.log

echo %1.obj > msvc.tmp

echo ..\lib\Fivehmx.lib ..\lib\FiveHCM.lib >> msvc.tmp

echo %hdir%\lib\rtl.lib >> msvc.tmp
echo %hdir%\lib\vm.lib >> msvc.tmp
echo %hdir%\lib\gtgui.lib >> msvc.tmp
echo %hdir%\lib\lang.lib >> msvc.tmp
echo %hdir%\lib\macro.lib >> msvc.tmp
echo %hdir%\lib\rdd.lib >> msvc.tmp
echo %hdir%\lib\dbfntx.lib >> msvc.tmp
echo %hdir%\lib\dbfcdx.lib >> msvc.tmp
echo %hdir%\lib\dbffpt.lib >> msvc.tmp
echo %hdir%\lib\hbsix.lib >> msvc.tmp
echo %hdir%\lib\debug.lib >> msvc.tmp
echo %hdir%\lib\common.lib >> msvc.tmp
echo %hdir%\lib\pp.lib >> msvc.tmp
echo %hdir%\lib\pcrepos.lib >> msvc.tmp

rem Uncomment these two lines to use Advantage RDD
rem echo %hdir%\lib\rddads.lib >> msvc.tmp
rem echo %hdir%\lib\ace32.lib >> msvc.tmp

rem echo msvcrt.lib >> msvc.tmp
echo kernel32.lib >> msvc.tmp
echo user32.lib >> msvc.tmp
echo gdi32.lib >> msvc.tmp
echo winspool.lib >> msvc.tmp
echo comctl32.lib >> msvc.tmp
echo comdlg32.lib >> msvc.tmp
echo advapi32.lib >> msvc.tmp
echo shell32.lib >> msvc.tmp
echo ole32.lib >> msvc.tmp
echo oleaut32.lib >> msvc.tmp
echo uuid.lib >> msvc.tmp
echo odbc32.lib >> msvc.tmp
echo odbccp32.lib >> msvc.tmp
echo mpr.lib >> msvc.tmp
echo msimg32.lib >> msvc.tmp
echo oledlg.lib >> msvc.tmp
echo version.lib >> msvc.tmp

IF EXIST %1.res echo %1.res >> msvc.tmp

"%vcdir%"\bin\link @msvc.tmp /NODEFAULTLIB:LIBC /nologo /subsystem:windows /force:multiple >> clip.log

IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c
@del msvc.tmp

:LINKERROR
ECHO * There are errors
GOTO EXIT

:SINTAX
ECHO SYNTAX: Build [Program] {-- No especifiques la extensi鏮 PRG
ECHO {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT
@type clip.log
set include=%__include%
set lib=%__lib%
cly166
 
Posts: 11
Joined: Sat Sep 25, 2010 2:36 pm

Re: missing _SetClassLongPtr

Postby cly166 » Tue Sep 28, 2010 12:15 pm

Dear Antonio:
May advice current status?
i also tried VS2005(in Win XP & Win7) with same error.
Regards
CLY
cly166
 
Posts: 11
Joined: Sat Sep 25, 2010 2:36 pm

Re: missing _SetClassLongPtr

Postby Antonio Linares » Tue Sep 28, 2010 3:19 pm

Cly,

Go to the folder where all your MSVC libraries are and look for SetClassLongPtr in all of them.

You can use a tool like "Total Commander" to do such search :-)

The function SetClassLongPtr should be inside user32.lib
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: missing _SetClassLongPtr

Postby cly166 » Wed Sep 29, 2010 1:49 am

Dear Antonio:
Here is the searching result in VS2005:
1. Not found SetClassLongPtr in any .lib, found SetClassLongA/W in user32.lib, unicows.lib. and coredll.lib only.
2. Following command connected with SetClassLongPtr is extracted from winuser.h, SetClassLongPtr seems only for _win64 compiling.
Regards
CLY
*------------------
WINUSERAPI
DWORD
WINAPI
SetClassLongA(
__in HWND hWnd,
__in int nIndex,
__in LONG dwNewLong);
WINUSERAPI
DWORD
WINAPI
SetClassLongW(
__in HWND hWnd,
__in int nIndex,
__in LONG dwNewLong);
#ifdef UNICODE
#define SetClassLong SetClassLongW
#else
#define SetClassLong SetClassLongA
#endif // !UNICODE

#ifdef _WIN64

WINUSERAPI
ULONG_PTR
WINAPI
GetClassLongPtrA(
__in HWND hWnd,
__in int nIndex);
WINUSERAPI
ULONG_PTR
WINAPI
GetClassLongPtrW(
__in HWND hWnd,
__in int nIndex);
#ifdef UNICODE
#define GetClassLongPtr GetClassLongPtrW
#else
#define GetClassLongPtr GetClassLongPtrA
#endif // !UNICODE

WINUSERAPI
ULONG_PTR
WINAPI
SetClassLongPtrA(
__in HWND hWnd,
__in int nIndex,
__in LONG_PTR dwNewLong);
WINUSERAPI
ULONG_PTR
WINAPI
SetClassLongPtrW(
__in HWND hWnd,
__in int nIndex,
__in LONG_PTR dwNewLong);
#ifdef UNICODE
#define SetClassLongPtr SetClassLongPtrW
#else
#define SetClassLongPtr SetClassLongPtrA
#endif // !UNICODE

#else /* _WIN64 */

#define GetClassLongPtrA GetClassLongA
#define GetClassLongPtrW GetClassLongW
#ifdef UNICODE
#define GetClassLongPtr GetClassLongPtrW
#else
#define GetClassLongPtr GetClassLongPtrA
#endif // !UNICODE

#define SetClassLongPtrA SetClassLongA
#define SetClassLongPtrW SetClassLongW
#ifdef UNICODE
#define SetClassLongPtr SetClassLongPtrW
#else
#define SetClassLongPtr SetClassLongPtrA
#endif // !UNICODE

#endif /* _WIN64 */

#endif /* !NOWINOFFSETS */
*------------------
cly166
 
Posts: 11
Joined: Sat Sep 25, 2010 2:36 pm

Re: missing _SetClassLongPtr

Postby cly166 » Thu Sep 30, 2010 12:01 pm

Dear Antonio:
May you send me compiled SKINS.obj using SetClassLong(instead of SetClassLongPtr) for me to test here?
Or send me source code for modification by myself if posible?
Regards
CLY
*------------------
cly166
 
Posts: 11
Joined: Sat Sep 25, 2010 2:36 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 64 guests