PlanetSquires Forums

Support Forums => General Board => Topic started by: Douglas McDonald on August 18, 2011, 06:35:18 PM

Title: VB6 - FF3 & PB
Post by: Douglas McDonald on August 18, 2011, 06:35:18 PM
I have a Small VB6 program that runs and I need to convert it to PB/FF3. I didn't write the .dll. My problem is with the .lib file (getting the type structures) The .dll is from National Instruments, VISA32.dll. In VB6 I just add it as a reference. Using Jose's typeLib browser I only get the following:

' ########################################################################################
' Library name: visa
' Version: 3.1, Locale ID = 0
' Description: VISA Library
' Path: C:\Windows\SysWow64\visa32.dll
' Library GUID: {39C32428-25DB-11D0-85B4-0020AF33DEAE}
' Help file: C:\Windows\System32\ni-visa.chm
' Code generated by the TypeLib Browser 4.0.13 (c) 2008 by Jose Roca
' Date: 18 Aug 2011   Time: 15:53:25
' ########################################################################################



How do I make an .inc that I can use with PB?

I have an attached the VB project (very small) and the .dll & .lib

I must be doing /overlooking something.

This is really something to ask Jose but I don't think now is the time to bother him.

Thanks
Title: Re: VB6 - FF3 & PB
Post by: Rolf Brandt on August 18, 2011, 07:39:39 PM
Hello Douglas,

I think the TypeLib Browser won't help because visa32.dll is not an ActiveX Dll but a pur 32-bit dll.

You need to modify the visa32.bas file and use it as include file.

Rolf
Title: Re: VB6 - FF3 & PB
Post by: Michael Stefanik on August 18, 2011, 08:01:58 PM
That was one of the nice features of VB. You could reference standard DLLs as long as they had a typelib resource that defined the functions and constants used by the libraries. It allowed developers to distribute standard DLLs to VB programmers without requiring separate include files.
Title: Re: VB6 - FF3 & PB
Post by: José Roca on August 18, 2011, 08:42:59 PM
My browser can deal with it using the "Modules" option, although I will have to modify it slightly since it has been fooled in a few parameters, that I have modified by hand in the generated code, because of the of VB's use of BYVAL STRING as a workaround for BYREF ASCIIZ.

A better translation could be done using the C++ headers instead of this type library.
Title: Re: VB6 - FF3 & PB
Post by: Douglas McDonald on August 19, 2011, 10:26:48 AM
Thank you all very much. I'll use Jose's file. PB10's libBrowser did show a bunch of macros.

Doug
Title: Re: VB6 - FF3 & PB
Post by: Douglas McDonald on August 19, 2011, 11:30:12 AM
Jose it worked great. As I said before I did use PB10's TypeLib Browser on the Visa32.dll to extract the MACROS and used your headers and API.

So if anyone needs to use the National Instruments VISA driver to talk to o-scopes,function generators ect... this will work be it USB Serial,GPIB and whatever else is supported by the driver. HP, Techtronics Rigol, Fluke and most others use this standard.

I have not put this into FF3 yet so its just PB10. Let me know if anyone wants a copy.

Thanks again

Doug
Title: Re: VB6 - FF3 & PB
Post by: José Roca on August 19, 2011, 01:51:00 PM
The macros aren't needed at all. Using macros to emulate typedefs is a can of worms that can lead to conflicts sooner or later.