From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI and Resource file

It is possible to load a menu from a resource file with LoadMenu (win32Api) in a CVI environment ?
I have generated a *.res file with rc.exe and i now want to lad a menu. I always get NULL as Return code from LoadMenu.
0 Kudos
Message 1 of 5
(2,980 Views)
I am unable to answer your question but I would advise you to either read the SDK documentation from windows on the menu and .res file requirements. Whenever you start touching on a subject where there is overlap between CVI and the Windows SDK functions there is a general lack of response from the guys in the formum. You might get some pointers in the right direction but i would take some time and commitment to get into the same level of detail of what you're trying to achieve. If you need more pointers on the lates downloads and SDK help documentations let me know. Sorry I could not be of more direct help.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 2 of 5
(2,980 Views)
Hi,

Is there a specific reason not to use the CVI menus? the CVI manus make the calls to the SDK for you and create the resource in your UIR file.

Using the SDK LoadMenu can be troublesome since you need to create the exe in CVI and then add the menu resource and then the exe could call LoadPanel. If you must use SDK menus you should consider migrating to Visual C++ and use there the CVI libraries.

I hope this helps; keep us posted...

Regards,

Juan Carlos
N.I.
Message 3 of 5
(2,980 Views)
Hello

For menus , it is not really necessary. But if i want to use special controls like TabCtrl.
I think it is the only way, to create a Resource with Visual C++ and then integrate it with the Win32SDK to CVI.
How can i add a *.res file to a existing EXE?
0 Kudos
Message 4 of 5
(2,980 Views)
Hi,

I have never heard of anyone integrating a resource file in CVI. The compiler creates a resource file that gets included in the exe; you can see it in the debug folder of your project. However CVI will overwrite this file every time the exe is built.

In the specific case of tab controls, CVI includes a custom control that allows you to create a tab control. You can find an example at C:\Program Files\National Instruments\CVI70\samples\userint\custctrl\easytab\ basically you create your panels and with a couple of calls you embed them in a tab control.

If you must use a resource file you may want to consider using the CVI libraries in Visual C++; this way you could leverage the best of the 2 world: CVI functions and VC++ .res file e
diting. There is a wizard that converts your CVI project to a VC++ project. Just create a mew Measurement Studio project in VC++ and select import CVI project.

I hope this helps, let me know if you have any further questions.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 5 of 5
(2,980 Views)