- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do not sem to get the functions
GETCHARWIDTH GETCHARWIDTH32 GetCharWidthFloat
to work in VISTA - are ther compatible functions in the latest Visual fortan which would work in VISTA
Link Copied
- 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
I have the program
USE DFWIN
USE DFLIB
IMPLICIT NONE
CHARACTER*15 TYPEFACE
INTEGER HFONT,HDC,RET
INTEGER NCHARS,I, NHGG,NW,ABCD(0:255)
REAL ABCD1(0:255)
TYPE (T_ABC) AB(0:255)
NCHARS=255
TYPEFACE="Arial"//char(0)
HDC = GETDC(NULL)
NHGG=-10000
NW=0
HFONT = CREATEFONT(-NHGG, NW, 0, 0, 0, 0, 0, 0, &
DEFAULT_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, &
PROOF_QUALITY,INT(DEFAULT_PITCH) ,TYPEFACE)
RET=SELECTOBJECT(HDC,HFONT)
RET=GETCHARWIDTH32 (HDC,1,NCHARS,LOC(ABCD(1)))
RET=GETCHARWIDTHFLOAT (HDC,1,NCHARS,LOC(ABCD1(1)))
RET=GETCHARABCWIDTHS(HDC,1,255,AB(1))
DO I=65,90
WRITE(*,*)I,' ',CHAR(I),ABCD(I),ABCD1(I),AB(I)%ABCA,AB(I)%ABCB,AB(I)%ABCC
ENDDO
STOP
END
In windows XP it lists the widths of characters between A and Z and all three functions
GETCHARWIDTH32 , GETCHARWIDTHFLOAT, GETCHARABCWIDTHS
give values, however under Vista I just get zeros, I am using Visual Fortran Vers 6.0
if I upgrade will the problem be resolved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't have immediate access to a Vista system to try your program. Perhaps another reader can comment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I compile and obtain the exe on an xp machine and transfer the exe to a vista machine where it does not produce the desired results
steve
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I checked and the font is available , and accoding to the MSDN site these should work in VISTA - but they do not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I don't have Vista on anything, how about running the below and reporting theresults
USE DFWIN
USE DFLIB
IMPLICIT NONE
CHARACTER*15 TYPEFACE
INTEGER HFONT,HDC,RET
INTEGER NCHARS,I, NHGG,NW,ABCD(0:255)
REAL ABCD1(0:255)
TYPE (T_ABC) AB(0:255)
NCHARS=255
TYPEFACE="dingers"//char(0)
HDC = GETDC(NULL)
NHGG=-10000
NW=0
HFONT = CREATEFONT(-NHGG, NW, 0, 0, 0, 0, 0, 0, &
DEFAULT_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, &
PROOF_QUALITY,INT(DEFAULT_PITCH) ,TYPEFACE)
write(*,*)'hfont=',hfont,getlasterror()
RET=SELECTOBJECT(HDC,HFONT)
write(*,*)'selobjret=',ret,getlasterror()
RET=GETCHARWIDTH32 (HDC,1,NCHARS,LOC(ABCD(1)))
write(*,*)'cw32ret=',ret,getlasterror()
RET=GETCHARWIDTHFLOAT (HDC,1,NCHARS,LOC(ABCD1(1)))
write(*,*)'cwfret=',ret,getlasterror()
RET=GETCHARABCWIDTHS(HDC,1,255,AB(1))
write(*,*)'abcwret=',ret,getlasterror()
DO I=65,90
WRITE(*,*)I,' ',CHAR(I),ABCD(I),ABCD1(I),AB(I)%ABCA,AB(I)%ABCB,AB(I)%ABCC
ENDDO
END
- 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
this is result from windows XP
hfont= 1208633627 0
selobjret= 25821217 0
cw32ret= 1 0
cwfret= 1 0
abcwret= 1 0
65 A 5970 373.1250 -13 5996 -13
66 B 5970 373.1250 656 4838 476
67 C 6464 404.0000 446 5664 354
68 D 6464 404.0000 691 5297 476
..................
and from Vista
hfont= 1376391332 0
selobjret= 25821253 0
cw32ret= 0 0
cwfret= 0 0
abcwret= 0 0
65 A 0 0.0000000E+00 0 0 0
66 B 0 0.0000000E+00 0 0 0
67 C 0 0.0000000E+00&nb
sp; 0 0 0
68 D 0 0.0000000E+00 0 0 0
...............
- 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
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jugoslav those links do point to a possible problem - not sure what you mean by
a "real" DC
steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For the start, try GetDC(GetDesktopWindow()). Alternatively, you can try creating (and destroying later!) a memory DC, using
hDC = GetDC(GetDesktopWindow())
hMemDC = CreateCompatibleDC(hDC)
ret = CreateCompatibleBitmap(hDC , 100, 100)
iSt = SelectObject(hMemDC, hBmp)
...
!do stuff here
...
ret = DeleteObject(GetCurrentObject(hMemDC, OBJ_BITMAP)
ret = DeleteDC(hMemDC)Note that a) I admit this is an overkill for such a simple task and b) I'm stabbing in the dark...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi jugoslav thanks - that did dont work either - but i will try anything to get it to work
steve
- 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
Guido
- 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