LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Lost linkage to UIR Callbacks in VisC

I am attempting to use a Labwindows generated interface in a Visual C++ project.
I have generated the UIRCallbackTable.c file, and have included it in my
project, as well as the header file containing the LW Panel and Control IDs,
and the .UIR file.

The problem I have is that the linkage of the UIR to the callbacks seems
schizophrenic. Sometimes I compile, and can LoadPanel(...) just great.
Othertimes, the LoadPanel(...) causes the run-time error -86 complaining
that a callback function is unknown. I have checked and double-checked that:

The right callback name is in both the UIR file, and the table generated
in UIRCallbackTable.c. The UIRCallbackTable.c file should be compiled with
C external linkage.

The he
ader file holding the constants also is generated with the Callback
prototypes, but it has the standard #ifdef __cplusplus
extern "C" {
#endif ...
encapsulation of the prototypes.

Any clues on what gives?

Thanks,
Mark
0 Kudos
Message 1 of 5
(3,537 Views)
Mark
Do you use Measurement Studio? Then I suggest to install ComponentWorks++.
It includes the "NI Measurement Studio AppWizard", which can create a VC
Project from an CVI Project. All settings and callback files are setup by
the wizard, and it works very good for me.

Stephan

Mark Greenman schrieb in im Newsbeitrag:
396cf947@newsgroups.ni.com...
>
> I am attempting to use a Labwindows generated interface in a Visual C++
project.
> I have generated the UIRCallbackTable.c file, and have included it in my
> project, as well as the header file containing the LW Panel and Control
IDs,
> and the .UIR file.
>
> The problem I have is that the linkage of the UIR to the callbacks seems
> schizophrenic. Sometimes I compile, and can LoadPanel(...) j
ust great.
> Othertimes, the LoadPanel(...) causes the run-time error -86 complaining
> that a callback function is unknown. I have checked and double-checked
that:
>
> The right callback name is in both the UIR file, and the table generated
> in UIRCallbackTable.c. The UIRCallbackTable.c file should be compiled
with
> C external linkage.
>
> The header file holding the constants also is generated with the
Callback
> prototypes, but it has the standard #ifdef __cplusplus
> extern "C" {
> #endif ...
> encapsulation of the prototypes.
>
> Any clues on what gives?
>
> Thanks,
> Mark
0 Kudos
Message 2 of 5
(3,537 Views)
Hi Stephan,

Yes, I have it installed, and have been trying to use it. However, (and
this may be related to the problems I am having), I have moved/put my callback
function definitions in several .cpp files. I want to be able to instantiate
and use C++ objects from within the callbacks. The LW generated header file
that contains the Panel and Control constant ID's also generates declarations
for the callback functions. The declarations in this file are enclosed in
a extern "C" { ... } body when C++ compilation is detected. I include this
header in the .cpp files where I actually define the callback functions.


Am I correct in understanding that the Wizard will:

1) generate callback function declarations
2) update the array __UICallbackSymbols and associated array length constant
__UICallbackSymbolCount

upon a UIR file update.

Does it do anything else?

Thanks for all the help,

Mark

"Stephan Gerhards" wrote:
>Mark>Do you use Measurement Studio? Then I suggest to install ComponentWorks++.>It
includes the "NI Measurement Studio AppWizard", which can create a VC>Project
from an CVI Project. All settings and callback files are setup by>the wizard,
and it works very good for me.>>Stephan>>Mark Greenman
schrieb in im Newsbeitrag:>396cf947@newsgroups.ni.com...>>>> I am attempting
to use a Labwindows generated interface in a Visual C++>project.>> I have
generated the UIRCallbackTable.c file, and have included it in my>> project,
as well as the header file containing the LW Panel and Control>IDs,>> and
the .UIR file.>>>> The problem I have is that the linkage of the UIR to the
callbacks seems>> schizophrenic. Sometimes I compile, and can LoadPanel(...)
just great.>> Othertimes, the LoadPanel(...) causes the run-time error -86
complaining>> that a callback function is unknown. I have checked and double-checked>that:>>>>
The right callback name is in both the UIR file, and the table generated>>
in UIRCallbackTable.c. The UIRCallbackTable.c file should be compiled>with>>
C external linkage.>>>> The header file holding the constants also is generated
with the>Callback>> prototypes, but it has the standard #ifdef __cplusplus>>
extern "C" {>> #endif ...>> encapsulation of the prototypes.>>>> Any clues
on what gives?>>>> Thanks,>> Mark>>
0 Kudos
Message 3 of 5
(3,537 Views)
I have tried using the UIR -> code generator, and now everything is working
fine. I am beggining to suspect that my problems were related to VisC pre-compiled
header usage and not anything that LW's UIR wizard was doing.

thanks again for the help,
Mark
0 Kudos
Message 4 of 5
(3,537 Views)
I have encountered the same problem as yours. Does you mean that you have solved your problem? But I still haven't and I don't understand "UIR->code generator". Does you mean the menu item "Code->Generator->All code" in Labwindows/CVI? I believe the header file for the uir file is generated this way, isn't it? Thank you very much.
0 Kudos
Message 5 of 5
(3,537 Views)