16,465
社区成员
发帖
与我相关
我的任务
分享
TCHAR szApp[MAX_PATH] = TEXT("F:\\(11]]'''';s a.as s gs_ ___'asg'a)\\Demo.exe");
ShellExecute(NULL, NULL, szApp, NULL, NULL, 0);
#include "stdafx.h"
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
ShellExecute(NULL, NULL,
_T("\"CallDll.exe\""),
NULL,
_T("E:\\TEMP\\TestDll\\(11]]'''';s a.as s gs_ ___'asg'a)\\Demo"),
SW_SHOWNORMAL);
return 0;
}
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "stdafx.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
extern "C" __declspec( dllexport ) long Func(long p1, long p2)
{
return p1 + p2;
}
// TestDll.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <conio.h>
extern "C" __declspec( dllexport ) long Func(long p1, long p2);
#pragma comment(lib, "../Debug/DllPrj.lib")
int _tmain(int argc, _TCHAR* argv[])
{
long a=0,b=0;
printf("Input a, b: ");
scanf_s("%d,%d", &a, &b);
printf("Fun(%d, %d)=%d\n", a,b, Func(a, b));
_getch();
return 0;
}