rtdll原型 
__declspec(dllimport) bool WINAPI Start(unsigned short udpPort, char* errorMsg);
jni
JNIEXPORT jboolean JNICALL Java_TestDll_1Start
(JNIEnv *, jclass, jint udpport){
int nRetCode = 0;
// 初始化 MFC 并在失败时显示错误
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: 更改错误代码以符合您的需要
_tprintf(_T("错误: MFC 初始化失败\n"));
nRetCode = 1;
}
else
{
// TODO: 在此处为应用程序的行为编写代码。
char errorMsg[256] = "";
Start(udpport,errorMsg);   //这个地方错了
printf("%s %i\r\n",errorMsg,udpport);
}
return nRetCode;
}
C++ main代码
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0; // 初始化 MFC 并在失败时显示错误
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: 更改错误代码以符合您的需要
_tprintf(_T("错误: MFC 初始化失败\n"));
nRetCode = 1;
}
else
{
// TODO: 在此处为应用程序的行为编写代码。
int udpPort = 1234;
        char errorMsg[256] = "";
        bool procRtn = false; 
        procRtn = Start(udpPort,errorMsg); //这样就没问题
                ///.....
} return nRetCode;
}