| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3556 人关注过本帖
标题:程序运行时,第二行显示错误是什么意思,这个错误怎么解决?谢谢大家喽!
只看楼主 加入收藏
清香傅天心
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2015-5-20
结帖率:90%
收藏
已结贴  问题点数:20 回复次数:2 
程序运行时,第二行显示错误是什么意思,这个错误怎么解决?谢谢大家喽!
错误显示:Cannot open include file: 'stdafx.h': No such file or directory,

全部程序如下:
// vissim_c.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#define _WIN32_DCOM
#include <iostream>
using namespace std;
// import of all VISSIM COM server interfaces
#import "c:\\Program Files (x86)\\PTV_Vision\\VISSIM540\\Exe\\vissim.exe" // modify
path to your needs
using namespace VISSIM_COMSERVERLib;
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr;
cout << "Client: Calling CoInitialize()" << endl;
hr = CoInitialize(NULL);
if (FAILED(hr)) return 1;
try {
// Create the Vissim object (connection to VISSIM COM server)
cout << "Client: Creating a Vissim instance with the smartpointer IVissimPtr" <<
endl;
IVissimPtr spVissim(__uuidof(Vissim));
// Create a Simulation object
cout << "Client: Calling GetSimulation()" << endl;
// read network and layout
spVissim -> LoadNet ("c:\\vissim_c\\vissim_files\\c_test.inp", 0);
spVissim -> LoadLayout ("c:\\vissim_c\\vissim_files\\vissim.ini");
// initialize simulations
cout << "Client: Setting simulations" << endl;
// run simulations
ISimulationPtr spSim;
spSim = spVissim -> GetSimulation();
cout << "Client: Starting simulation" << endl;
spSim -> RunContinuous();
}
catch (_com_error &error) {
cout << (char*)(error.Description()) << endl;
}
cout << "Client: Calling CoUninitialize()" << endl;
CoUninitialize ();
return 0;
}
搜索更多相关主题的帖子: include server import file 
2016-05-19 22:03
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:528
帖 子:9008
专家分:53957
注 册:2011-1-18
收藏
得分:10 
Cannot open include file: 'stdafx.h': No such file or directory,
中文翻译是:无法打开include文件“stdafx.h”,没有这个文件或目录
2016-05-19 22:18
仰望星空的
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:50
专家分:248
注 册:2015-9-28
收藏
得分:10 
“stdafx.h”不是一般的C++程序都自带的嘛,也许在别的文件中已经被编译过了,楼主可以试着注释掉这一行,看会不会对程序有影响;
2016-05-20 08:44
快速回复:程序运行时,第二行显示错误是什么意思,这个错误怎么解决?谢谢大家喽 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.058009 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved