Problem with VB.Net 2003 - Btest4 example

VBA and general Excel Q&A and examples

Moderator: DPlotAdmin

Post Reply
marcusmccallum
Posts: 1
Joined: Wed Jan 17, 2007 11:50 am

Problem with VB.Net 2003 - Btest4 example

Post 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
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post 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.
Visualize Your Data
support@dplot.com
Post Reply