08-02-2012 03:36 AM
Utility library function GetExternalModuleAddr (admittedly marked as obsolete - but key to one of our oldish but much cherished bits of software) fails with error code in CVI 2010SP1 (W7)
The suggested alternative Win32 API GetProcAddress doesn't work with source or obj files (so isn't an alternative at all)
Also tried CVI 8.1.1 on XP - code works fine
I think it worked fine on CVI 9.1.0 with W7 (before I upgraded) - but can't be sure
Any suggestions (code compiles OK in all cases) ?
Two C modules (in this stripped down version of real code) project as follows:
File "Main.c"
#include <utility.h>
int main(void)
{
void (*funcPtr) (void);
int moduleID;
int status;
moduleID = LoadExternalModule ("Test.c");
funcPtr = GetExternalModuleAddr (moduleID, "test_function", &status);
(*funcPtr) ();
return 0;
}
______________________________
File "Test.c"
void test_function(void)
{
}
Solved! Go to Solution.
08-02-2012 05:31 AM
Make sure you have Enable LoadExternalModule checked in your Target Settings.
08-02-2012 05:50 AM
Joe M
Yes that's the answer
I checked the Environment and Build Options but not the Target Settings. Our own build doumcntaiotn tells me to make sure this option is checked. Embarassing but at least now I know why !
Thanks