techmanbd Posted September 19, 2003 Posted September 19, 2003 I am adding a module that was made for VB6 and get errors. It is for GPIB and sets up functions using a dll. I pasted the beginning of the code, but the rest is the same alll through, but too long to paste whole thing. The error says "statement is not valid in a namspace". I kno wit is probably something simple but still new to .NET Attribute VB_Name = "VBIB32" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' 32-bit Visual Basic Language Interface ' Version 1.7 ' Copyright 1998 National Instruments Corporation. ' All Rights Reserved. ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' This module contains the subroutine declarations, ' function declarations and constants required to use ' the National Instruments GPIB Dynamic Link Library ' (DLL) for controlling IEEE-488 instrumentation. This ' file must be 'added' to your Visual Basic project ' (by choosing Add File from the File menu or pressing ' CTRL+F12) so that you can access the NI-488.2 ' subroutines and functions. ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' NI-488.2 DLL entry function declarations option Explicit Declare Function ibask32 Lib "Gpib-32.dll" Alias "ibask" (ByVal ud As Long, ByVal opt As Long, ByVal value As Long) As Long Declare Function ibbna32 Lib "Gpib-32.dll" Alias "ibbnaA" (ByVal ud As Long, sstr As Any) As Long Declare Function ibcac32 Lib "Gpib-32.dll" Alias "ibcac" (ByVal ud As Long, ByVal v As Long) As Long Declare Function ibclr32 Lib "Gpib-32.dll" Alias "ibclr" (ByVal ud As Long) As Long Declare Function ibcmd32 Lib "Gpib-32.dll" Alias "ibcmd" (ByVal ud As Long, sstr As Any, ByVal cnt As Long) As Lon Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
*Experts* mutant Posted September 19, 2003 *Experts* Posted September 19, 2003 Using modules in an OOP language like VB.NET is not very good :) You have to indicate that you are using a module, which you didnt need in vb6: Module ModuleName 'code End Module Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.