// 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 ", pMsgData); char *a = "ParseBaliseMsg2 hello word!"; strcpy(resStr, a); printf("resStr is: %s ", resStr); time_t rawtime; struct tm * timeinfo; time(&rawtime); timeinfo = localtime(&rawtime); printf("The current date/time is: %s ", 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 ", pMsgData); char *resStr = "ParseBaliseMsg3 hello word!"; printf("resStr is: %s ", resStr); time_t rawtime; struct tm * timeinfo; time(&rawtime); timeinfo = localtime(&rawtime); printf("The current date/time is: %s ", asctime(timeinfo)); retInt = 130; return resStr; } extern "C" __declspec(dllexport) int ParseBaliseMsg4(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 ", pMsgData); char *a = "ParseBaliseMsg4 hello word!"; strcpy(resStr, a); printf("resStr is: %s ", resStr); time_t rawtime; struct tm * timeinfo; time(&rawtime); timeinfo = localtime(&rawtime); printf("The current date/time is: %s ", asctime(timeinfo)); return 140; } extern "C" __declspec(dllexport) int ParseBaliseMsg5(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 ", pMsgData); char *a = "ParseBaliseMsg5 hello word!"; strcpy(resStr, a); printf("resStr is: %s ", resStr); time_t rawtime; struct tm * timeinfo; time(&rawtime); timeinfo = localtime(&rawtime); printf("The current date/time is: %s ", asctime(timeinfo)); return 150; } extern "C" __declspec(dllexport) char* strcpyTest(char* dest, char* sour) { char* temp = dest; while ('