04-10-2007 11:39 PM
04-11-2007 12:25 AM
this is the continution of above question. i can able to view all the functions in "function name" of 'Call Library function node' which are available in my dll and "DllCanUnloadNow, DllGetClassObject, DllRegisterServer, and DllUnregisterServer" functions too.
will it work this call library function node for my VB win32 dll. but while listing the function its not displaying the parameters(arguments) of functions.for this what i need to do ?
04-11-2007 02:54 PM
04-12-2007 03:52 AM
Hi,
Thanks for reply. I already had gone through those documents. Actually, I have a VB dll. A function in VB dll requires the string as an input parameter. The example code of that VB function looks like this:
Public Function mystring(ByRef str As String) As String
Dim str1 As String
str = StrConv(str, vbUnicode)
str = str + "world"
mystring = StrConv(str1, vbFromUnicode)
mystring = str
End Function
I called this function in Labview by using “Call Library Function Node” with the parameters as follows:
Function name: mystring
Calling Convention: stdcall (WINAPI)
Parameter:
I gave an input string as “Hello”. When I am trying to run the VI, I am getting an exception that “An exception occurred within the external code called by a call library function node. This might have corrupted LabVIEW’s memory. Save any work to a new location and restart LabViewi.”
Moreover, the same error I am getting for passing charecter array too.
VB code:
Public Function mychar(var() As Byte) As Long
newchar = var(0)
End Function
I called this function in Labview by using “Call Library Function Node” with the parameters as follows:
Function name: mychar
Calling Convention: stdcall (WINAPI)
Parameter:
1. return type Type: Numeric Data Type: Signed 32-bit Integer
2. arg1 Type: Array Data Type: Unsigned 8-bit Integer. Dimension: 1 Array Format: Array Data Pointer
Can you please tell me why I am getting this error and how to recover this?
Thanks,
Bannu.
04-13-2007 10:25 AM
04-14-2007 06:17 AM
The functions you list would indicate that the DLL is really an ActiveX component. These are the exported functions that regsrv32 and the OS use to manage OLE (ActiveX) DLLs and it would probably make sense since I believe that newer Visual Basic versions tend to favour ActiveX over normal shared library call interfaces.
@bannu wrote:
this is the continution of above question. i can able to view all the functions in "function name" of 'Call Library function node' which are available in my dll and "DllCanUnloadNow, DllGetClassObject, DllRegisterServer, and DllUnregisterServer" functions too.
will it work this call library function node for my VB win32 dll. but while listing the function its not displaying the parameters(arguments) of functions.for this what i need to do ?
04-16-2007 02:04 AM
Thank you for your reply. ya now am using ActiveX Vis. My dll is having somany functions. in dll these functions are defined as classes.
for example my dll having functions like init(), close();
i called the function init(), its working fine. its initialising my required software.
but when i tried to call(execute) the second function, its giving the error that, "Error -2146827864 occurred at Exception occured in Project1: Object required in close test.vi" . can you please tell me y m getting this type of error. and how can i rectify this.?
thanks,
bannu.
04-16-2007 02:40 PM
Sorry! I can't help you with this really. Would seem like your ActiveX library is expecting something that does not come over correctly from LabVIEW somehow and then your DLL crashes. To debug this one would need the Visual Basic project, the eventual external libraries your DLL depends on and the LabVIEW VIs, but I have pledged years ago to never touch Visual Basic if I can avoid it in any way.
@bannu wrote:
Thank you for your reply. ya now am using ActiveX Vis. My dll is having somany functions. in dll these functions are defined as classes.
for example my dll having functions like init(), close();
i called the function init(), its working fine. its initialising my required software.
but when i tried to call(execute) the second function, its giving the error that, "Error -2146827864 occurred at Exception occured in Project1: Object required in close test.vi" . can you please tell me y m getting this type of error. and how can i rectify this.?
thanks,
bannu.
04-17-2007 07:35 AM
Thank you for response. ya i got the solution. i need to create a single class with functions. by using class object i need to call the function required.
thanks,
bannu.
10-17-2008 03:32 PM
Bannu wrote:Thank you for response. ya i got the solution. i need to create a single class with functions. by using class object i need to call the function required.
I am having the same problem. Could you expand on your solution? Did the changes occur in VB or LabView?
Thank you,
Tessa