Page 1 of 1

A Problem with tailbite and ASM code

Posted: Wed Nov 23, 2005 10:28 am
by Hurga
Hi out there

I have a strange problem with my lib code.
It works fine, when I compile it.
But when I use tailbite, it crashes while tailbiteing it.
The error returned ist "eax is not a valid operator.

Has anyone an Idea how to solve this.
Here is the code, and the error is reported here: MOV EAX, [_PB_2DDrawing_CurrentDC]

Inline asm is activated. The "_PB_2DDrawing_CurrentDC" is declared als !Extrn. (as i said, it runs fien when I com pile it, just probs with tailbite.

Code: Select all

Procedure.l SG_GetTextHeight() ; returns the height of the current font
  hDC.l
  MOV EAX, [_PB_2DDrawing_CurrentDC]
  MOV hDC, EAX
  
  CompilerIf #Compiler_OSWin
  GetTextMetrics_(hDC, tm.TEXTMETRIC)
  ProcedureReturn tm\tmHeight
  CompilerEndIf
EndProcedure
Any Help?
Thx

Posted: Wed Nov 23, 2005 11:29 am
by El_Choni
Hi,

You must 'include' the 2DDrawing library in your lib, using this:

Code: Select all

TB_Include2DDrawing()
!Extrn _PB_2DDrawing_CurrentDC
Regards,