LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX and LabVIEW (again!)

Hi to all,
I'd like to know if there is a way to create a COM compliant dll in
labview, e.g. a dll that I can register via regsvr32 and be loaded from a
scripting language (VBScript or JavaScript).

The problem is that javascript will not allow me to load a "simple" dll
from the filesystem, and apparently labview cannot create an activex dll.
As Wiebe@AIR pointed out, I should add some registry keys to register my
dll but I didn't find any docs on the subject.

Any suggestion?

Thank you in advance

Marcello Barboni
0 Kudos
Message 1 of 7
(3,230 Views)
Marcello,

Create a new vi, with one output (num I32), call it 'return value' or
something like that. The value can be zero (S_OK) or keep it unwired. Wire
it to the connector pane. Save the VI a DllRegisterServer.vi

Do the same again, but call the vi DllUnregisterServer.vi.

Note that you can put popup windows (one button dialogs) in the vi's, for
testing purposes.

When building the dll, add the two vi's to the project as 'Add Exported
VI...'. Select the indicator 'return value' as 'return value'.

Now you can call Regsvr32.exe to register and unregister the dll! I don't
know what else VBScript needs, but so far so good...

Please let me know your preceedings...

Regards,

Wiebe.



"Marcello Barboni" wrote in message
news:Xns920784B5
D9567nospamnospamit@130.251.200.249...
> Hi to all,
> I'd like to know if there is a way to create a COM compliant dll in
> labview, e.g. a dll that I can register via regsvr32 and be loaded from a
> scripting language (VBScript or JavaScript).
>
> The problem is that javascript will not allow me to load a "simple" dll
> from the filesystem, and apparently labview cannot create an activex dll.
> As Wiebe@AIR pointed out, I should add some registry keys to register my
> dll but I didn't find any docs on the subject.
>
> Any suggestion?
>
> Thank you in advance
>
> Marcello Barboni
0 Kudos
Message 2 of 7
(3,230 Views)
The previous awnser will fool the regsvr32.exe, but does not 'do' anything.
The functions should add stuff to the registry. The following link explains
what needs to be added:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/automat/htm
_hh2/chap2_71o3.asp

I'll try to make an example, but might take some time...

Regards,

Wiebe.



"Wiebe@AIR" wrote in message
news:ab8k9i$7bc$1@news1.xs4all.nl...
> Marcello,
>
> Create a new vi, with one output (num I32), call it 'return value' or
> something like that. The value can be zero (S_OK) or keep it unwired. Wire
> it to the connector pane. Save the VI a DllRegisterServer.vi
>
> Do the same again, but call the vi DllUnregisterServer.vi.
>
> Note that you can put popup wi
ndows (one button dialogs) in the vi's, for
> testing purposes.
>
> When building the dll, add the two vi's to the project as 'Add Exported
> VI...'. Select the indicator 'return value' as 'return value'.
>
> Now you can call Regsvr32.exe to register and unregister the dll! I don't
> know what else VBScript needs, but so far so good...
>
> Please let me know your preceedings...
>
> Regards,
>
> Wiebe.
>
>
>
> "Marcello Barboni" wrote in message
> news:Xns920784B5D9567nospamnospamit@130.251.200.249...
> > Hi to all,
> > I'd like to know if there is a way to create a COM compliant dll in
> > labview, e.g. a dll that I can register via regsvr32 and be loaded from
a
> > scripting language (VBScript or JavaScript).
> >
> > The problem is that javascript will not allow me to load a "simple" dll
> > from the filesystem, and apparently labview cannot create an activex
dll.
> > As Wiebe@AIR pointed out, I should add some registry keys to register my
> > dll but I didn't find
any docs on the subject.
> >
> > Any suggestion?
> >
> > Thank you in advance
> >
> > Marcello Barboni
>
>
0 Kudos
Message 4 of 7
(3,230 Views)
> I'd like to know if there is a way to create a COM compliant dll in
> labview, e.g. a dll that I can register via regsvr32 and be loaded from a
> scripting language (VBScript or JavaScript).
>
> The problem is that javascript will not allow me to load a "simple" dll
> from the filesystem, and apparently labview cannot create an activex dll.
> As Wiebe@AIR pointed out, I should add some registry keys to register my
> dll but I didn't find any docs on the subject.
>


The feature in LV to build DLLs is referring to the basic, pre-COM form
of a DLL. I am not sure if anyone has successfully built VIs to conform
to the entrypoints for COM, and the other step that would be necessary
is to build a typelib file, which I believe that the CVI compiler does

for you if you are using it to build the DLL. Anyway, there isn't a one
button option for building OCXes or COM capable DLLs, at least not in
the current version.

Greg McKaskle
0 Kudos
Message 3 of 7
(3,230 Views)
I need this capability, too.

That is, I want to be able to create a COM-compliant DLL of code that
I wrote in LabVIEW. If COM is so great that LabVIEW has ActiveX
functions, then why wouldn't I want to use it? And why wouldn't
everyone else, even those in my company that are developing code in
languages other than LabVIEW?

Or is LabVIEW just another dead-end language, unlike all the prominent
platforms that do support creation of COM-compliant DLLs?

After all, what good is ActiveX support in LabVIEW if LabVIEW can't
even go full circle with itself?

That's like a person claiming to be a translator, but upon further
questioning, one finds them claiming that they can translate Spanish
into English, or English into Spanish, but can't translate Spanish

into English & back into Spanish.

That is, LV should be able to build a DLL that can be called using the
LV ActiveX VIs.
0 Kudos
Message 5 of 7
(3,230 Views)
I understand from Greg McCaskle's answer that this is something which
may come in future (And judging how far LabVIEW has come, I'm sure it
will be incorporated).

If you're developing code in other languages which create
COM-compliant DLLs, then is it not possible to write a wrapper DLL in
this other language and register this instead...

I agree that this would be a nice thing to have, but even without it,
LabVIEW has established itself as a powerful tool for test and
measurement.

If you need ActiveX-enabled DLLs, then at the moment you should use
another language to do it. The right tool for the right job and so
on.

Shane.
0 Kudos
Message 6 of 7
(3,230 Views)
shoneill wrote in message news:<506500000005000000B05B0100-1075935269000@exchange.ni.com>...
> I understand from Greg McCaskle's answer that this is something which
> may come in future (And judging how far LabVIEW has come, I'm sure it
> will be incorporated).
>
> If you're developing code in other languages which create
> COM-compliant DLLs, then is it not possible to write a wrapper DLL in
> this other language and register this instead...
>
> I agree that this would be a nice thing to have, but even without it,
> LabVIEW has established itself as a powerful tool for test and
> measurement.
>
> If you need ActiveX-enabled DLLs, then at the moment you should use
> another language to do it. The right tool for the right
job and so
> on.
>
> Shane.

You could build the dll from LV, then wrap it in a COM/ActiveX DLL
built in Visual Basic.

Jeff
0 Kudos
Message 7 of 7
(3,230 Views)