c++ 代码部分:
// CDLLDemo.cpp : 定义 DLL 应用程序的导出函数。
//
#include "stdafx.h"
#include "string.h"
#include <stdio.h>
#include <time.h>
extern "C" __declspec(dllexport)
int ParseBaliseMsg2(const unsigned char *pMsgData, char *resTgm, char *resStr)
{
/*CString strInfo;
strcpy(resTgm, strMsg.GetBuffer());
strMsg = strFor1 + strMsg + strFor2;
strInfo += "erro!!!";
strcpy(resStr, strInfo.GetBuffer());*/
//memset(resStr, 0, 50);
printf("%s \r\n", pMsgData);
char *a = "ParseBaliseMsg2 hello word!";
strcpy(resStr, a);
printf("resStr is: %s \r\n", resStr);
time_t rawtime;
struct tm * timeinfo;
time(&rawtime);
timeinfo = localtime(&rawtime);
printf("The current date/time is: %s \r\n", asctime(timeinfo));
return 120;
}
extern "C" __declspec(dllexport)
char * ParseBaliseMsg3(const unsigned char *pMsgData, char *resTgm, int & retInt)
{
/*CString strInfo;
strcpy(resTgm, strMsg.GetBuffer());
strMsg = strFor1 + strMsg + strFor2;
strInfo += "erro!!!";
strcpy(resStr, strInfo.GetBuffer());*/
//memset(resStr, 0, 50);
printf("%s \r\n", pMsgData);
char *resStr = "ParseBaliseMsg3 hello word!";
printf("resStr is: %s \r\n", resStr);
time_t rawtime;
struct tm * timeinfo;
time(&rawtime);
timeinfo = localtime(&rawtime);
printf("The current date/time is: %s \r\n", asctime(timeinfo));
retInt = 130;
return resStr;
}
extern "C" __declspec(dllexport)
int ParseBaliseMsg4(const unsigned char