Using EasyHID with VBExpress 2005 (maybe .NET as well)


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Using EasyHID with VBExpress 2005 (maybe .NET as well)

    You can download Here a small code template to start using EasyHID DLL with VBExpress.

    'Till now (june 5/2007) EasyHID don't generate the code template for VBExpress but VB5. I tested it a little bit here, and it seems to be reliable and bug free.

    As we all know, David (Mecanique) have been kind enough to do this wonderful software & dll 100% free of charge. Knowing he's busy with something else, i think at least, we owe him a little hand with newer Microsoft Language platform.

    This said, this would be nice to hear some comments from user here with this simple code template.

    When i find some time, i'll do the VisualC Express template as well.

    Thanks again David!

    PS: the code template don't include any PIC code. Just VBExpress side. You could use the USBDemo one. The TextBox will show you the ADC results of AN0
    Last edited by mister_e; - 6th June 2007 at 03:38.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Thanks to you!

    Quote Originally Posted by mister_e View Post
    ....
    Thanks again David!
    ....
    Thanks again Steve!


    --------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Thank you Steve and David.

    The VB5/Express part was my hold up.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Thanks guys, don't forget to post your "It's working or not" comments...

    As i write it, (~24 hours later) the template have been downloaded 76 times already

    Finger crossed
    Last edited by mister_e; - 7th June 2007 at 02:13.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Feb 2007
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Have been playing with this and it works great.

    Only thing is that I can not get hidGetVendorName and hidGetProductName to work. I get an "Attempted to read or write protected memory" error with this and i'm not sure if im doing something wrong or that theres a problem with this .net version.

    Thanks
    Abnormal1

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yup, Yet another .NET thingy. 'Till now, i have found a way to make it work....
    Code:
       Public Sub OnPlugged(ByVal pHandle As Integer)
        Dim DeviceHandle As Integer
                                  ' Mister E 
        Dim VendorName As String = "         "
                                   ' USB Demo
        Dim ProductName As String = "         "
    
        If hidGetVendorID(pHandle) = VendorID And hidGetProductID(pHandle) = ProductID Then ' Good one?
            '
            '   get the device handle
            '   =====================
            DeviceHandle = hidGetHandle(VendorID, ProductID)
            '
            '   Get the vendor and product name from the handle
            '   ===============================================
            hidGetVendorName(DeviceHandle, VendorName, 255)
            hidGetProductName(DeviceHandle, ProductName, 255)
            End If
        Label2.Text = VendorName
        label3.text = ProductName
    The trick is to assign a value to VendorName and ProductName before calling hidGetVendorName and hidGetProductName. Make sure your space/blank character are at least equal to the LEN if VendorName and ProductName. Unless, it will screw up things.

    VB.NET doesn't seems to have a way to determine a fixed String size...

    Anyways, i've ask the question on the MSDN forum, let's see if there's a more elegant way to do it. It has to... In meantime, the above solution work.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Replies: 4
    Last Post: - 5th November 2008, 16:21
  2. Problem with enumeration and EasyHID
    By jizyjuice in forum USB
    Replies: 22
    Last Post: - 9th April 2007, 20:40
  3. EasyHID and VB.net
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th September 2006, 05:40
  4. HIDMakerFS versus EasyHID
    By Demon in forum USB
    Replies: 4
    Last Post: - 15th August 2006, 08:01
  5. Replies: 0
    Last Post: - 5th September 2005, 09:09

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts