ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
01-05-2010 01:25 AM
ok this is my c++ project but im calling the DLL in CVI, it works. but the only function that is not doing what i want it to do is void Function(void);
when I call it in CVI , its not print to the screen. do you know why is that ?
#include <iostream>
#include "DLL_Practice.h"
extern "C"
{
DECLDIR int Add( int a, int b )
{
return( a + b );
}
DECLDIR void Function( void )
{
std::cout << "DLL Called!" << std::endl;
}
}
DLL_Practice.h
**************************************
#ifndef _DLL_PRACTICE_H_
#define _DLL_PRACTICE_H_
#include <iostream>
#define DECLDIR __declspec(dllexport)
extern "C"
{
DECLDIR int Add( int a, int b );
DECLDIR void Function( void );
}
#endif
my CVI .c file looks like this of how im calling the various functions i created from the c++ project
void Function(void);
int Add(int a,int b);
int main()
{
int sum=0;
Function();
sum=Add(4,5);
printf("%d",sum);
GetKey();
return 0;
}
01-05-2010 06:05 AM
can someone tell me why void Function (void) will not print out to the screen when calling it in CVI.
my ADD function works fine, but my 2nd function is not executing.
extern "C"
{
DECLDIR int Add( int a, int b )
{
return( a + b );
}
DECLDIR void Function( void )
{
std::cout << "DLL Called!" << std::endl;
}
}