menghuihantang Posted January 12, 2010 Report Share Posted January 12, 2010 (edited) Manufacture provides an ActiveX control to use in LabVIEW. One function "OpenConnection (ServerName: PChar; out Result: OleVariant) requires a Pascal PChar type; when accessed from LabVIEW, it is converted to String type. I tried to wire a normal LabVIEW string, it returned an error saying the ActiveX Server is not installed or registered. I manually registered the server, but it still returns the same error. I tried to convert the LabVIEW string to a Pascal type, like shown in the picture (put the string length in the beginning and a NULL in the end to make it a null-terminated string), still the same error. My guess is that the problem still lies in the string, it is not compatible with the Pascal type. But how can I convert the string in this case? Edited January 12, 2010 by menghuihantang Quote Link to comment
candidus Posted January 21, 2010 Report Share Posted January 21, 2010 I don't think that you need a pascal String. Since you're working with an ActiveX object all data types must be automation compatible, however, pascal string aren't. The only string type type allowed for use with ActiveX is BSTR. LabVIEW converts string arguments automatically to that type. If your method really would require a pascal string you couldn't even select it (LabVIEW disables methods that aren't automation compatible in the dropdown list). It seems there must be another problem. Your error message usually means that the object isn't registered properly (Sometimes manual registering seemed to work but in fact it didn't). Perhaps some requirements of your component are missing. Verify that your ActiveX object is registered properly and creatable, e.g. with Microsoft's OleView utility. Quote Link to comment
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.