1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

vb help asap

Discussion in 'Visual Basic ( VB )' started by badkalel14, Oct 11, 2010.

  1. badkalel14

    badkalel14 New Member

    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?:(
     
    Last edited by a moderator: Oct 11, 2010
  2. virxen

    virxen New Member

    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 and shabbir like this.
  3. badkalel14

    badkalel14 New Member

    thank you man! you really helped me alot!
     

Share This Page