Rotation vfp helpfiles not working  
Author Message
Fox Me Up





PostPosted: Visual FoxPro General, Rotation vfp helpfiles not working Top

this code is copied straight from vfp 9.0 help files. i just added the two paramateres

this code works in vfp and when i run just the application on the computer that has vfp installed. however it is not working on non vfp computers. on a non vfp computer all i see is a wait window that says rendering and its tallying up the pages.

PARAMETERS REPNAME,ANGLE_OF_TILT
LOCAL oListener
oListener = CREATEOBJECT("rotateText")
oListener.ListenerType = 1
REPORT FORM &REPNAME OBJECT oListener

#define FRX_OBJCOD_PAGEHEADER 1

DEFINE CLASS rotateText AS ReportListener

IsInPageHeader = .F.

PROCEDURE Init()
DECLARE integer GdipRotateWorldTransform In GDIPlus.Dll ;
integer graphics,single angle,integer enumMatrixOrder_order
DECLARE integer GdipTranslateWorldTransform In GDIPlus.Dll ;
integer graphics,single dx,single dy,;
integer enumMatrixOrder_order
DECLARE integer GdipSaveGraphics IN GDIPlus.DLL ;

DECLARE integer GdipRestoreGraphics IN GDIPlus.DLL ;
integer graphics, integer xx
ENDPROC

PROCEDURE BeforeBand(nBandObjCode, nFRXRecNo)
DODEFAULT(nBandObjCode, nFRXRecNo)
IF (nBandObjCode = FRX_OBJCOD_PAGEHEADER)
THIS.IsInPageHeader = .T.
ENDIF
ENDPROC

PROCEDURE AfterBand(nBandObjCode, nFRXRecNo)
IF (nBandObjCode = FRX_OBJCOD_PAGEHEADER)
THIS.IsInPageHeader = .F.
ENDIF
DODEFAULT(nBandObjCode, nFRXRecNo)
ENDPROC

PROCEDURE Render(nFRXRecNo, nLeft, nTop, nWidth, nHeight,;
nObjectContinuationType, cContentsToBeRendered, GDIPlusImage)
LOCAL xx,x,y, z
xx = 0
IF THIS.IsInPageHeader
* get appropriate versions of coords
x = nLeft
y = nTop

* save the current state of the graphics handle

* now move the 0,0 point to where we'd like it to be
* so that when we rotate we're rotating around the
* appropriate point
z = GdipTranslateWorldTransform(this.GDIPlusGraphics,x,y,0)
* should check z here -- will be 0 if no error occurred

* now change the angle at which the draw will occur
z = GdipRotateWorldTransform ( this.GDIPlusGraphics,ANGLE_OF_TILT,0)
* should check z as above

* restore the 0,0 point
z = GdipTranslateWorldTransform(this.GDIPlusGraphics,-x,-y, 0)
* should check z as above

ENDIF

* explicitly call the baseclass behavior
* when we are ready for it
DODEFAULT(nFRXRecNo, nLeft, nTop, nWidth, nHeight, ;
nObjectContinuationType, cContentsToBeRendered, ;
GDIPlusImage)

* put back the state of the graphics handle
IF THIS.IsInPageHeader
GdipRestoreGraphics(this.GDIPlusGraphics, xx)
ENDIF

* don't let the baseclass render
* when and how it would otherwise do it
NODEFAULT

ENDPROC

ENDDEFINE



Visual FoxPro1  
 
 
AndyKr





PostPosted: Visual FoxPro General, Rotation vfp helpfiles not working Top

>>this code works in vfp and when i run just the application on the computer that has vfp installed. however it is not working on non vfp computers. on a non vfp computer all i see is a wait window that says rendering and its tallying up the pages.

Sounds like a GDIPlus issue! Check that the DLL is installed on "non-vfp computers". This code won't work if GDIPlus is not present!!!



 
 
Fox Me Up





PostPosted: Visual FoxPro General, Rotation vfp helpfiles not working Top

i did Start->Run cmd - REGSVR32 GDIPlus.DLL i get the error "GDIPlus.DLL was loaded , but the dllregisterserver entry point was not found. this file cannot be registered."

i get this error when trying to do it on both computers. the one with foxpro and the one without foxpro.


CAUTION:::::: after attempting to run this program to turn the text sideways i have found out that now i cannot print normal reports. Normal reports are now justl openining and closeing right away.



 
 
AndyKr





PostPosted: Visual FoxPro General, Rotation vfp helpfiles not working Top

>> Run cmd - REGSVR32 GDIPlus.DLL

NO! I didn't say "register it" you just have to ensure that the file is present and can be lcoated by VFP. GDIPlus is NOT a DLL that can be registered using RegSvr - as you found out!



 
 
Fox Me Up





PostPosted: Visual FoxPro General, Rotation vfp helpfiles not working Top

how do you install this dll file

 
 
AndyKr





PostPosted: Visual FoxPro General, Rotation vfp helpfiles not working Top

>> How do you install....

Copy it to the machine! It should be located in the VFP common files directory which is usually something like:

C:\Program Files\Common Files\Microsoft Shared\VFP

 This should be part of your application setup so that any machine that needs the tool will have it.