by rolf » Wed, 01 Feb 2006 21:10:39
I need to distribute some code in a (LabVIEW) DLL, but a bug in LabVIEW
6.1 prevents me from distributing the 6.1 DLL so I'm compiling it
under 7.1. It then works great when called by a 7.1 VI,
but calling it from 6.1 produces the dreaded " Fatal Internal Error : "memory.cpp", line 638 LabVIEW version 7.1 ".:smileymad: Most of the applications here are in 6.1, upgrading working programs to 7.1 or 8.0 is not realistic. Any
insight - especially know incompatabilities between 6.1 and
7.1 - would be greatly appreciated - I could use a work-around. Thanks! :smileyhappy: (a bit more detail...) The bug in 6.1 is that neither the "GetRows" or "GetString" ADODB.RecordSet methods correctly return "null" values. I don't think it would be "Kosher" to post the code, but here's a bit more specific info related to DLL parameter-types: INPUTS (Qty, Descript, Type, DataFormat 2, Clusters, AdaptToType, HandlesByValue 1, Enum, Numeric(U16),Value 1, ArrayOfClusters, AdaptToType,PointersToHandles OUTPUTS 2, Clusters, AdaptToType, HandlesByValue 2, ArrayOfClusters, AdaptToType,PointersToHandlesYou
can't use LabVIEW datatypes in the DLL interface if the DLL is to run
in a different LabVIEW process than the LabVIEW system calling it. In
your case the DLL is running in the LabVIEW 7.1 runtime system while
you call it from a LabVIEW 6.1 runtime or development system. The array
handles allocated by your LabVIEW 6.1 system are totally and utterly
meaningless to the LabVIEW 7.1 runtime system but since it is a LabVIEW
handle in the API definition the DLL code simply assumes that it is
valid to resize them at a certain point. ->>>> General
Protection Fault.
The only solution is to define your DLL API in a way that uses C
datatypes. With them it is always so that the caller allocates all the
memory necessary for parameters for the callee to be used so that the
DLL function does not have to (and it really can't) resize the
parameters.
Rolf Kalbermatter