Page 1 of 1

Help to fix the error

Posted: Wed Apr 11, 2018 2:24 am
by Eugene Lutsenko
The strange thing is that at home I have this error does not occur, and the work arises. In another function of the same program I use exactly the same call and it does not result in an error at work. I can't understand why.

Code: Select all

@ 0,0 DCSTATIC TYPE XBPSTATIC_TYPE_BITMAP CAPTION mFileName OBJECT oStatic1 ;
      PREEVAL {|o|o:autoSize := .t.} EVAL {|o|hDC1 := GetWindowDC(o:getHWnd()), o:motion := {|a,b,o|ShowColorTr( hDC1, a, oSay, o )},;
      aPixel := Array(o:caption:xSize,o:caption:ySize), o:paint := {|a,b,o|Gratest(o)}}

Re: Help to fix the error

Posted: Wed Apr 11, 2018 3:07 am
by Tom
I have a similar problem with (tons of) icons from a (huge) DLL. It seems to be a kind of timing problem. The object creation is not finished yet, since it takes so much time. I solved it by checking the object state with o:Status(). Only if o:Status() returns XBP_STAT_CREATE, o:xSize is available.

Re: Help to fix the error

Posted: Wed Apr 11, 2018 3:27 am
by Eugene Lutsenko
Thanks, Tom! I have also encountered similar gaps elsewhere in the programme. But I was just making a delay. Unfortunately it doesn't always work, though getting better. And a very big delay did not want to do. how do you write this status check in the program?

Re: Help to fix the error

Posted: Wed Apr 11, 2018 10:10 am
by Eugene Lutsenko
Now I have established that the cause of the error is different. Tom! What you're saying is interesting in itself, too.