Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lost linkage to UIR Callbacks in VisC

19 views
Skip to first unread message

Mark Greenman

unread,
Jul 12, 2000, 3:00:00 AM7/12/00
to

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

Stephan Gerhards

unread,
Jul 13, 2000, 3:00:00 AM7/13/00
to
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 <ma...@sdl.usu.edu> schrieb in im Newsbeitrag:
396c...@newsgroups.ni.com...

Mark Greenman

unread,
Jul 13, 2000, 3:00:00 AM7/13/00
to

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

Mark Greenman

unread,
Jul 13, 2000, 3:00:00 AM7/13/00
to

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 new messages