Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21431

error in using API MoveToEx

$
0
0
hi,
I'm using API function Movetoex with LineTo to draw line on a form in a graphics software. A run time error 10 This array is fixed or temporarily locked is arriving at the movetoex line below is the code I have used.

Declare Function MoveToEx Lib "GDI32.dll" (ByVal hDc As Long, ByVal x As Long, ByVal y As Long, lpPoint As Any) As Long

redPen = CreatePen(PS_SOLID, 1, vbRed)
DeleteObject SelectObject(Prn.hDc, redPen)
Call MoveToEx(Mpartview.hDc, CLng(xa1 - 10), CLng(ya1), Null)

' MsgBox "cr----1
Call LineTo(Mpartview.hDc, CLng(xa1 + 10), CLng(ya1))
' Call LineTo(Prn.hDc, CLng((wID / 2) + 10), CLng(hei / 2))

Call MoveToEx(Mpartview.hDc, CLng(xa1), CLng(ya1 - 10), Null)
Call LineTo(Mpartview.hDc, CLng(xa1), CLng(ya1 + 10))

xa1 and ya1 are the pixel values , calculated , where the crosshair lines are tobe drawn. this function works first time when software is made on after that according to graphics ( point/line/circle) on a form scaling is done and value of point where the crosshair is tobe drawn is calculated and redrawn at this time the error occurs. previously this error was
occuring during exe of prj running but now it is in the project run also.
may I get help ?

Viewing all articles
Browse latest Browse all 21431

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>