Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   vb help asap (http://www.go4expert.com/forums/vb-help-asap-t23551/)

badkalel14 11Oct2010 17:56

vb help asap
 
ok heres my problem, i recently wrote a code for visual basic that can just basicly turn off and turn on an embebbed system with leds and heres the code
Code:

Option Strict Off

Option Explicit On

Module InpOut32_Declarations

    Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Short) As Short

    Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Short, ByVal Value As Short)

End Module

Code:

Option Strict Off

Option Explicit On
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Out(&H378S, &H0S)

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Out(&H378S, &HFFS)
    End Sub
End Class

there so my problem is, my teacher said i am suppose to use vb6 which i taught was vb,now i want some help to change this into vb6 format, anyone please?:(

virxen 11Oct2010 19:19

Re: vb help asap
 
1) open vb6
2) go to form1 and add command button 1 and 2
3) double click command1 and add
Code:

Private Sub Command1_Click()
Out Val(&H378), Val(&H0)
End Sub

3) double click command2 and add
Code:

Private Sub Command2_Click()
Out Val(&H378), Val(&HFF)
End Sub

4)go to project menu-->add module (new) module1
5)double click module1 and add
Code:

Public Declare Function Inp Lib "inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)


badkalel14 11Oct2010 21:08

Re: vb help asap
 
thank you man! you really helped me alot!


All times are GMT +5.5. The time now is 03:31.