当前位置:编程学习 > C#/ASP.NET >>

c#无法读取c++写的dll

代码如下:
// SendSM.cpp : 定义控制台应用程序的入口点。
#include "stdafx.h"
#include "CMPPAPI.hpp"
#include "windows.h"
#include "string.h"
#include "atltime.h"

int _tmain()
{
char LogFile[100];
char  str[100];
char str1[100];
char str2[100];
char        *ConfigFile = "../config/sms.ini";
FILE *fplog=NULL;
CTime theTime = CTime::GetCurrentTime();
CString strtime = theTime.Format( "%m/%d %H:%M:%S" );

GetPrivateProfileString("LOG","logfile","../config/smstemp.log",LogFile, 100, ConfigFile);
if((fplog = fopen(LogFile, "a+")) == NULL) {
fprintf(stderr, "\tSendSM Can't open Log file: %s\n",LogFile);
exit(1);
}

if(getenv("NX_NTF_VOICE_PHONE")!=NULL)
{
fprintf(fplog, "<person><time1>%s</time1> <phone>%s</phone> \n", strtime,memcpy(str , getenv("NX_NTF_VOICE_PHONE") , strlen(getenv("NX_NTF_VOICE_PHONE")) + 1));
}
else {
fprintf(fplog, "<person><rtime>%s</rtime><error>Parameter Error!!!No SmsPhone En_Variable!!!</error></person>\n", strtime);
exit(1);
}

if(getenv( "NX_NTF_SUMMARY" )!=NULL){
fprintf(fplog, "<time2>%s</time2> <summary>%s</summary> \n", strtime,memcpy(str1 , getenv("NX_NTF_SUMMARY") , strlen(getenv("NX_NTF_SUMMARY")) + 1));
}  
else {
//printf("\n\nNo Msgtitle En_Variable!!!\n");
fprintf(fplog, "<person><rtime>%s</rtime><error>Parameter Error!!!No Msgtitle En_Variable!!!</error></person>\n", strtime);
exit(1);
}

if(getenv( "NX_NTF_MESSAGE" )!=NULL){
fprintf(fplog, "<time3>%s</time3> <message>%s</message></person> \n", strtime,memcpy(str2 , getenv("NX_NTF_MESSAGE") , strlen(getenv("NX_NTF_MESSAGE")) + 1));
}
else{
//printf("\n\nNo Msgbody En_Variable!!!\n");
fprintf(fplog, "<person><rtime>%s</rtime><error>Parameter Error!!!No Msgbody En_Variable!!!</error></person>\n", strtime);
exit(1);
}


    fclose(fplog);
return 0;
}
问题:代码没有什么问题,关键dll输出以后,c#无法找到这个方法,我用类写过这个方法,也不太行,希望各位高手帮把给我~~ --------------------编程问答-------------------- 没人知道么?失望 --------------------编程问答--------------------  看看是不是少个模块定义文件 def
; sss.def : 声明 DLL 的模块参数。
LIBRARY      "sss"

EXPORTS
    ; 此处可以是显式导出
--------------------编程问答-------------------- 显示导出什么?
补充:.NET技术 ,  VC.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,