Archived

This topic is now archived and is closed to further replies.

EdwardD

Problems with VB.NET...

Recommended Posts

Im using DX9 and VB.NET I do the following but it does not seem to pass the surface and rect into the other sub, the string works fine. If I change the ddsSurface & myRect withing the BMPLoad sub to ddsLogo & rLogo then it works fine. Anybody have any idea why this wouldnt work?, I used to do this the same way in Visual Basic 6 and it worked fine: public sub Main() BmpLoad(ddsLogo, rLogo, "C:\My Projects\Magic Dust - DX9\bin\Data\Logo.bmp") end sub Public Sub BmpLoad(ByVal ddsSurface As Surface, ByVal myRect As System.Drawing.Rectangle, ByVal nameFile As String, Optional ByVal TransCol As Integer = 0) Dim SDes As New SurfaceDescription() '' Describes a surface. Dim ck As New ColorKey() ddsSurface = Nothing Try ''Load sprite ddsSurface = New Surface(nameFile, SDes, DD) ddsLogo.SetColorKey(ColorKeyFlags.SourceDraw, ck) rLogo = New System.Drawing.Rectangle(0, 0, 800, 600) ''SDes.Width, SDes.Height) Catch Debug.WriteLine("Error loading:" + nameFile) End Try End Sub

Share this post


Link to post
Share on other sites
Thanks, that worked.

.NET automatically sets them to ByVal if you dont specify which one to use. In Visual Basic 6 if you didnt specify it would set it to the correct one. So now I need to remember to specify each time

Share this post


Link to post
Share on other sites