Hi everybody,
I'm used to C++ OOP principles but I've never really understood dll's very well. I'm working on a code segment as shown below. It's a dll function. What I need to know is can I compile it directly or do I need to do something special?
I'm using bloodshed and it doesn't compile with this. Do I need
#define API_DLLEXPORT extern "C" __declspec(dllexport)
HINSTANCE hIQ_Measure; // handle for IQ_Measure DLL
hIQ_Measure = LoadLibrary("IQ_Fact.dll"); // you only need to do this once
typedef IQ_RESULT_TYPE *(*DLL_PROC)( LPTSTR);
typedef IQ_RESULT_SWEEP_TYPE *(*DLL_SWEEP_PROC)(LPTSTR);
typedef LOG_RESULT_TYPE *(*DLL_LOG_PROC)(char *);
API_DLLEXPORT bool LabV_IQ_verify_TX_EVM ( char *sPara, int *pass,
int *num_results, char *description, char *test_name, char *result_text,
int test_result_pass[], double test_limit_upper[], double test_limit_lower[], double test_measure[] )
{
bool error=false;
IQ_RESULT_TYPE *ret;
DLL_PROC call;
int TestItem;
// obtain_control Dll Fuction
call = (DLL_PROC) GetProcAddress ( hIQ_Measure, "IQ_verify_TX_EVM" );
ret = call ( sPara );
// Move the structed data to return native data types.
if (ret->error_occur_flag)
error=true;
Transfer_struct_to_native_datatypes ( ret,
pass, num_results, description, test_name, result_text,
test_result_pass, test_limit_upper, test_limit_lower, test_measure );
return (error);
}