Thanks Sergey, that's sorted it.
Jon
>Hi Jon,
>
>You hit a VFP bug. When Windows API function is declared w/o alias VFP releases any previous declarations with an alias.
>You can use a trick from GdiPlusX. Comment out DECLARE and create following function. If GS_SplitReleaseDC is not declared yet, the function will be called. Otherwise the function in DLL will be called.
>
>FUNCTION GS_SplitReleaseDC(hWnd, HDC)
>DECLARE Long ReleaseDC IN WIN32API AS GS_SplitReleaseDC Long hWnd, Long HDC
>RETURN GS_SplitReleaseDC(m.hWnd, m.HDC)
>
>>
>>Can anyone shed any light on this for me?
>>
>>This is declared in the toolbar:
>>declare integer ReleaseDC in WIN32API as GS_SplitReleaseDC integer hWnd, integer HDC
>>? GS_SplitReleaseDC(0,-12345) && this is garbage but returns a result of 0.
>>
>>then:
>>_REPORTPREVIEW = ("c:\products\ppwin\dev9\ReportPreview.app")
>>EXTERNAL CLASS frxPreview.vcx
>>NewForm = NEWOBJECT([frxpreviewForm],[frxPreview],_REPORTPREVIEW)
>>loRef = NULL
>>DO (_REPORTPREVIEW) WITH loRef
>>repORT form "C:\Tmp\frx2any\Samples\VFP 9\VFP 9 Reports\usingchartenginewithvfp9.frx" preview
>>
>>If I try to call the following I get an error saying GS_SplitReleaseDC doesnt exist:
>>? GS_SplitReleaseDC(0,-12345) && now errors
>>
>>I have looked inside the ReportPreviewer project and I can see that it also declares ReleaseDC.
>>
>>Currently the only way I can see around this is to re-declare ReleaseDC after the previewer has finished, is there a better way to do this?
>>
>>Thanks
>>
>>Jon