高分求助,C#程序集

来源:百度知道 编辑:UC知道 时间:2024/05/04 10:26:21
要求编写一个WINDOWS控制台程序,以程序集的方式,实现2个以上的功能,有效代码不少于50行。。请各位大侠帮忙

// DllSample2.h : Defines the export functions and classes.

int _declspec(dllexport) Add(int a,int b);
void _declspec(dllexport) ShowString();

// DllSample2.cpp : Defines the entry point for the DLL application.
// Non-MFC DLLs的编写示例
// Non-MFC DLL:指的是不用MFC的类库结构,直接用C语言写的DLL,其输出
// 的函数一般用的是标准C接口,并能被非MFC或MFC编写的应用程序所调用
//

#include "DllSample2.h"
#include "stdafx.h"

/*
这是一个输出函数的例子
在输出函数或类的申明中用到_declspec(dllexport),
这是VC提供的一个关键字,用它可在动态连接库中输出一个数据、
一个函数或一个类。用这个关键字可省不少事,不用在.DEF文件
中说明要输出这个类、那个函数的

函数说明:略
参数说明:略
*/

int _declspec(dllexport) Add(int a,int b)
{

return (a+b);

}

void _declspec(dllexport) ShowString()
{

printf("Nice to see you,I suceed!");

}

/*
这是一个输出类的示例。
也用到了_declspec(dllexport)关键字
*/

class _d