您的位置:首页 > 编程语言

StartUp启动代码体会,隐藏Console main 函数

2011-07-10 01:25 106 查看
// test.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include"main.h"
#include<stdlib.h>
#pragma comment(lib,"main.lib")
void MyFuction();
void MyFunction1();
class student
{
public:
student()
{
printf("student\n");
pfn = MyFuction;

}
};
student st;
void MyFunction1()
{
printf("myfunction1\n");
}
void MyFuction()
{
printf("hello");
system("pause");
}
//==================================mian ib 库函数 ===============================//
//main.cpp
#include"stdafx.h"
#include"main.h"
#include<stdlib.h>
void(*pfn)() = NULL;
int main()
{
if(pfn!=NULL)
pfn();
printf("hide main function");
system("pause");
return 0;
}

//main.h

#include"stdafx.h"
extern "C" void(*pfn)();#include"stdafx.h"
extern "C" void(*pfn)();
运行结果截图

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: