代码编译成EXE后运行提示:IsBound() @ c:\bcb\emuvcl\utilcls.h/4249
楚天舒1 2011-07-04 11:44:49 //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "myFrom.h"
#include <windows.h>
#include <vcl\utilcls.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
pDBConfig = TDBConfig::getInstance();
char buffer[MAXPATH];
getcwd(buffer, MAXPATH);
String path = buffer; //GetPathAndBaseExeName();
pDBConfig->setAppPath(path);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Variant vPowerPoint;
try
{
vPowerPoint = CreateOleObject("PowerPoint.Application");//应该是这一句报错
}
catch(...)
{
ShowMessage("Error...");
}
//使PowerPoint 界面可视
vPowerPoint.OlePropertySet("Visible",true);
//打开一个剪切
//String strPptFile = "C:\\Documents and Settings\\Administrator\\桌面\\C++\\ppt\\zhongkang.ppt";//PPT文件路径and文件名
//String strPptFile = "..\\zhongkang.ppt";//PPT文件路径and文件名
String strPptFile = pDBConfig->GetIniFieldValue("FilePath");//PPT文件路径and文件名
vPowerPoint.OlePropertyGet("Presentations").OleFunction("Open",strPptFile.c_str(),false,false,true);
//放映这个剪切
vPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowSettings").OleFunction("Run");
Application->Terminate();
}
//---------------------------------------------------------------------------