don't use AfxMessageBox in COM that is designed for ASP, because messagebox is not visible to operator(ASP is running under a system account).
You can use OutputDebugString (its output can be seen by debugviewer,http://www.sysinternals.com/ntw2k/freeware/debugview.shtml)I guess the problem is that "c:\\Inetpub\\project\\excel\\%s.xls" is not accessible by the ASP file, you have to check if that file is accessible by web users.
You can use OutputDebugString (its output can be seen by debugviewer,http://www.sysinternals.com/ntw2k/freeware/debugview.shtml)I guess the problem is that "c:\\Inetpub\\project\\excel\\%s.xls" is not accessible by the ASP file, you have to check if that file is accessible by web users.
谢谢你的帮助,这个组件开始在asp中调用是没有问题的。后来希望生成临时不重复的文件名,改为如下后,才出现上述问题的!
TCHAR* szfilename;
szfilename = new TCHAR[512]; GetTempFileName("c:\\Inetpub\\project\\excel","xls",0,(LPSTR)szfilename );
CString strfilename(szfilename); strfilename.Replace("tmp","xls");
m_filename = szfilename; if (!DeleteFile(szfilename))
{
AfxMessageBox("delete file fail"); } m_filename.Replace("tmp","xls");
m_filename = strfilename.AllocSysString();
m_filename = strfilename.SetSysString();//m_filename是组件的属性,我希望用它返回给asp,来response.redirect到此文件,来下在.xls文件 结果在改回去也不行了,刚才我用ie上网时,也弹出对话框,标题IE.EXE,内容为指令引用了0x0000000内存,我遇到的问题是不是可能是ms的bug? 我怀疑是book.saveas的问题,可是也找不到此方法如何使用的资料,能像我推荐一些吗?
再次感谢你的帮助!!不过我不知道如何给你加分?请一并告知!