Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use ImaqViewer with mfc

Hi,

I would like to use the IMAQViewer in my mfc application made with VC++ 7.1 , with measurement studio 7.1 for VC++ , and IMAQ Vision 8.0.

I did try to " add class from an ActiveX "
, look for the " cwimaq.ocx "
, and select the " _CWIMAQViewer "

It makes a calss called " CDCIMAQViewer " instead of " CWIMAQViewer " that I see everywhere...

In My DialogBar, I put the " CWIMAQViewer Control (National Instruments) "  that I found in the .COM components.
Those in the .NET Components are not enabled...

How Am I suppose to use IMAQViewer  in my MFC ? ? ?

please help me.
Thank you.

0 Kudos
Message 1 of 5
(3,884 Views)
please, Help me Smiley Sad
0 Kudos
Message 2 of 5
(3,877 Views)

Hi Gael,

In the link below you can find example that will really help you:

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=D4361DF1958A0500E034080020E74861&p_...

Regards,

Sanaa T
National Instruments

Sanaa T.
National Instruments France

0 Kudos
Message 3 of 5
(3,837 Views)
Hi,
Thank you very much,
but actually, there is NOT ANY example where one use a CWIMAQViewer in C++
There are several differences between methodes in C++ and in VB
For example, there is no Palette attribute in the IMAQViewer in C++

And there are some VARIANT stuff that I don't understand.

the ReadImage( m_CwImage1, "c:\\test.bmp, m_CwViewer1.Palette) won't work
neither with m_CwViewer1.GetPalette(), because no cast between CWPalette and VARIANT
neither with m_CwViewer1.GetPalette().GetEntries which is the only method of a CWPalette that return a VARIANT that ReadImage DOES want as a third argument. it says "type mismatch" at run time in a warning box. ! ! ! !

so many stuff.

thank you anyway.
Gael



0 Kudos
Message 4 of 5
(3,833 Views)

For people looking back at these old posts the answer is that the CWIMAQViewer was not made to be used in the C environments and is made for VB.

 

Refer to the following locations for displaying images in C environments:

 

Start»All Programs»National Instruments»Vision»Documentation

Start»All Programs»National Instruments»Vision»Text Based Examples

 

Make sure that you look at the examples and documentation that is in reference to the C environments not the VB environments

 

Vince M
Applications Engineer
0 Kudos
Message 5 of 5
(3,043 Views)