Re: no accessible 'DrawText' is most specific

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: DF (MAPSONdofreem_at_comcast.netNOSPAM)
Date: 08/24/04


Date: Tue, 24 Aug 2004 07:53:34 -0400

Hi Jay,

This is the code:

batchSprite.Begin(DX3D.SpriteFlags.AlphaBlend Or _

DX3D.SpriteFlags.SortTexture)

Dim rect As New System.Drawing.Rectangle(5, 5, 0, 0)

viewFont.DrawText(batchSprite, _

Convert.ToString(Val), _

rect, _

DX3D.DrawTextFormat.NoClip, _

System.Drawing.Color.Yellow)

batchSprite.End()

I'm using Visual Studio 2003. The viewFont.DrawText code above has the blue
squiggly lines underneath. When I mouseover it, I get a yellow box that
basically says "overload resolution failed. No accessible

'DrawText' is most specific." message. There are two options in the box. One
contains a ByRef rect and the other ByVal rect. Since I can't figure out how
to tell VB which one to use, I can't compile the code.

Any advice?

Thanks for you time,

DF

"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com> wrote in message
news:#B9$k1YiEHA.592@TK2MSFTNGP11.phx.gbl...
> DF,
> You cannot override a method based on ByRef & ByVal, you will get a
compile
> error on one of the methods themselves. Primarily because VB.NET does not
> have a construct to specify which one to use.
>
> Where & How is DrawText defined that you managed to get both ByRef & ByVal
> overloads?
>
> Hope this helps
> Jay
>
>
>
> "DF" <MAPSONdofreem@comcast.netNOSPAM> wrote in message
> news:u6JPFxXiEHA.3988@tk2msftngp13.phx.gbl...
> DrawText is overloaded - one of which accepts a ByVal rect and the other
> accepts a ByRef rect. I get a "no accessible 'DrawText' is most specific"
> error. How can I resolve this problem by forcing VB to recognize the one I
> want?
>
> Any help would be greatly appreciated.
>
> DF
>
>



Relevant Pages