📄 testdl.cpp
字号:
// testdl.cpp
#ifdef _Windows
#define EXTERN extern "C" __declspec (dllexport)
#else
#define EXTERN extern "C"
#endif
#ifdef _Windows
#include <windows.h>
#ifdef __BORLANDC__
#pragma hdrstop
#include <condefs.h>
// string (iterator, iterator) gives this warnig:
#pragma warn -8012
#else
#error Compiler not tested.
#endif
#endif
#include <iostream>
#include <string>
using std::string;
#ifdef _Windows
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
return 1;
}
#endif
EXTERN int testfunc (int nparams, int * param)
{
if (nparams != 1)
return 1;
string * pstr= reinterpret_cast <string *> (param [0]);
string nstr ( pstr->rbegin (), pstr->rend () );
// Do not use * pstr= nstr nor assign a string longer than * pstr.
pstr->assign (nstr);
return 0;
}
// Fin de testdl.cpp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -