04-28-2017 09:03 AM
Hi All
For a customer I need to create a LabVIEW dll which they can call from their VB6 environment (yes they should upgrade to something else, but that's a different discussion). I have tried to figure out how to do that, but so far with no success.
I have found this old post about how to do it: http://forums.ni.com/t5/Example-Program-Drafts/Calling-LabVIEW-created-dll-from-Visual-Basic6/ta-p/3... and it seem to work ok for sending data from VB6 to LV.
However, I am not able to recreate it when I build something myself.
What I have tried to do is as follows
Private Declare Function ml_str _
Lib "C:\Users\tsuser\Desktop\LVdll_ToFrom_VB6_ml\ml_vb6.dll" _
(ByVal strin As String, _
ByVal strout As String, _
ByRef strlen As Integer) As Long
Private Sub Command1_Click()
Dim instring As String
Dim outstring As String
Dim lengthstr As Integer
Dim retur As Long
instring = "Hello World"
retur = ml_str(instring, outstring, lengthstr)
End Sub
When I try to run the VB6 program I get the following error message: "Run-time error 48: File not found". From googling around
Any suggestions on what I'm doing wrong?
Thanks and have a nice weekend
Martin
Solved! Go to Solution.
05-02-2017 01:53 AM
Bump
05-02-2017 06:43 AM
It seems like someone managed to make it work here (post is unrelated, but still the attached code can help you): http://forums.ni.com/ni/board/crawl_message?board.id=230&message.id=3826
05-05-2017 01:29 AM
Thanks for the link, I hadn't found that exact example myself. Though it wasn't the answer to my specific problem it helped me in the right direction, as I tried to compile the dll with different versions of LV until I realised that I had compiled my own dll in the 64-bit version of LV-2016, which VB6, of course, can't handle - Sometimes the easiest solutions are the hardest to find 😉