activex控件练习,实现在网页上读取一个文档中的内容但是无法实现

char CTest_01Ctrl::Readfile(char* pathname)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

// TODO: Add your dispatch handler code herechar a[100]; 
char a[100]; 
char str;
//char s[80]; 
int i=0;  
ifstream infile; 
infile.open(pathname);
while(!infile.eof())          
{   
   infile.getline(a,100,'\n');
    i++;                   
} 
for(int j=0;j<i;j++)       
{   
str+=a[j];        
} 
infile.close(); 
return str;

}

</p> <!-- function RunFunc() { var lNum=x.Add(document.getElementById("name1").value ,document.getElementById("name2").value ); var a=document.getElementById("name1").value; var b=document.getElementById("name2").value; alert(a+"+"+b+"="+lNum); } function RunFunc2() { var text=document.getElementById("name3").value; alert(MyActivex.Readfile(text)); } // --> <p>编译成功了,上一个加法运算可以的,但是下面这个读取文件点击网页没反应,求大神帮看看是不是文件读取写的不对.

首先在activex container test里面测试下,测试好了,再在网页测试。要先注册,并且调低浏览器安全等级。