Page 1 of 1

Problem with VB.Net 2003 - Btest4 example

Posted: Wed Jan 17, 2007 11:52 am
by marcusmccallum
Hi David,



I have downloaded the DPlot Jr. I am having trouble getting it too run on VB.NET 2003. The problem is in the following file of the BTest4.vb file.



Private Sub Picture1_Paint(ByVal eventSender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs)

Dim hdc As Integer

Dim ret As Integer



Dim g As Graphics = e.Graphics

If hemf <> 0 Then

g.Clear(Color.White)

hdc = g.GetHdc ---------------------------àLine 522

ret = PlayEnhMetaFile(hdc, hemf, rcPic)

g.ReleaseHdc(hdc) ------------------------àLine 524

End If

End Sub





The error returned is

C:\Marcus\DPlot Attempt\BTEST4.VB(522): Value of type 'System.IntPtr' cannot be converted to 'Integer'.

C:\Marcus\DPlot Attempt\BTEST4.VB(524): Value of type 'Integer' cannot be converted to 'System.IntPtr'.





Any ideas on how to fix this?



Regards

Marcus

Posted: Thu Jan 18, 2007 1:27 am
by DPlotAdmin
I don't have VB.Net 2003, but I'd guess from the error messages that you should change:

Dim hdc As Integer

to

Dim hdc As IntPtr

Please let me know if that doesn't work.