LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to call a Component Object Model (COM) object

Hello,
 
I am trying to call on a Component Object Model (COM) object from the shell32.dll but I don't know how.
I have tired the open library function vi but don't seem to be able to get through that way.
 
Thanks you your help in advance.
0 Kudos
Message 1 of 16
(10,621 Views)
Use the nodes in the ActiveX palette. ActiveX is a specific type of COM, but the palette nodes work with any COM object. You can also take a look in examples/comm for examples using these nodes. Basically, you'll start with the Open Automation node to create the instance of the COM object (equivalent to the Win32 method CoCreateInstance) and then use the invoke and property nodes to access the instance.
Message 2 of 16
(10,614 Views)
Hello Brian Tyler
 
I followed your instruction but I ran into another problem ~
I can't find the COM with the control
 
on this website
 
I have found this section that I want to use:

Modifying the Contents of the Taskbar

Version 4.71 and later of Shell32.dll adds the capability to modify the contents of the taskbar. From an application, you can now add, remove, and activate taskbar buttons. Activating the item does not activate the window; it shows the item as pressed on the taskbar.

The taskbar modification capabilities are implemented in a Component Object Model (COM) object (CLSID_TaskbarList ) that exposes the ITaskbarList interface (IID_ITaskbarList ). You must call the HrInit method to initialize the object. You can then use the methods of the ITaskbarList interface to modify the contents of the taskbar.

but I can't seen to find it.

Oh and I visited your blog, it is awesome, the nano car article is cool

thanks for your help

Jimmy

0 Kudos
Message 3 of 16
(10,605 Views)
Glad you liked the blog 🙂 Yeah, that nano-car is almost unbelievable.
 
Okay, I've never used this control, so I'm not sure what type library it's defined in. I tried browing shell32.dll and comctl32.dll, but neither had it. I did some googling on CLSID_TaskbarList, but everything I found seems to indicate that there isn't a type library already built for it. Unfortunately, if it doesn't have a type library, you can't use it in LabVIEW. However, since so many people use it, you might be able to find an example program with an IDL defined for it. That can create a typelib.
Message 4 of 16
(10,581 Views)


@Lycangeek wrote:
Glad you liked the blog 🙂 Yeah, that nano-car is almost unbelievable.
 
Okay, I've never used this control, so I'm not sure what type library it's defined in. I tried browing shell32.dll and comctl32.dll, but neither had it. I did some googling on CLSID_TaskbarList, but everything I found seems to indicate that there isn't a type library already built for it. Unfortunately, if it doesn't have a type library, you can't use it in LabVIEW. However, since so many people use it, you might be able to find an example program with an IDL defined for it. That can create a typelib.


Lots of shell32 objects are rather rudimentar COM objects, using COM infrastructure but not implementing enough to be a real ActiveX object. Most also simply lack any typelib definition anywhere so won't be usable from any browsable ActiveX implementation like LabVIEW or Visual Basic anyhow.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 5 of 16
(10,567 Views)

Hello

so following that thought, I would have to start some c code, but I don't have a c compiler, would labview be able to compile c code? My guess is no. So there is no way I can make this thing work thenSmiley Mad

0 Kudos
Message 6 of 16
(10,564 Views)
Yeah, I'm afraid you must get a C/C++ compiler in this case - VB, LabVIEW, C#, VB.NET - all these languages require a type library before you can use the COM component. However, you might search around to see if anyone else has already created a type library for this. When I did a brief search yesterday, I saw several discussions amoung VB programmers - which gives good chances that there is one out there.
 
The other option is for you to create one yourself. That simply requires that you create an IDL file that defines the COM class (I saw segments of this in the search) and then compile the IDL file. I believe the IDL compiler is part of the Windows SDK, which is a free download.
Message 7 of 16
(10,556 Views)


@slingee wrote:

Hello

so following that thought, I would have to start some c code, but I don't have a c compiler, would labview be able to compile c code? My guess is no. So there is no way I can make this thing work thenSmiley Mad



LabVIEW is not a C compiler. So you will need another software (Visual C, Borland C, possibly MingW based compiler) if you want to do this.

Another possibility is to look for a LabVIEW Toolkit that does all this for you. There are two possibilities I know of:

- George Zou's library at http://www.geocities.com/gzou999/

- Inventeerings InvTray Toolkit at http://www.inventeering.com/Product_INVtray.html

Rolf Kalbermatter

Message Edited by rolfk on 06-28-2006 04:47 PM

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 8 of 16
(10,555 Views)
hello
It's been a while, but, here I am again.
I don't know what to do after I've got the IDL file. I can't install the window sdk into my company computer. Is there another way to get this working Brian?
0 Kudos
Message 9 of 16
(10,481 Views)
I compiled the IDL for you, but I had to remove the IUnknownVB since that would not compile - and I'm not sure why you'd need it.
 
I'm afraid after this, you're off the trail and into the underbrush...good luck!
 
 
Message 10 of 16
(10,463 Views)