标题:程序运行时,第二行显示错误是什么意思,这个错误怎么解决?谢谢大家喽!
只看楼主
清香傅天心
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2015-5-20
结帖率:90%
已结贴  问题点数:20 回复次数:4 
程序运行时,第二行显示错误是什么意思,这个错误怎么解决?谢谢大家喽!
错误显示: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 21:54
清香傅天心
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2015-5-20
得分:0 
别人给的程序,由于没学过C++语言,所以这可能是C++语言
2016-05-19 22:00
yuantkong
Rank: 2
等 级:论坛游民
威 望:3
帖 子:82
专家分:86
注 册:2016-5-17
得分:8 
#include "stdafx.h" 这个是头文件,调用库文件函数. 换成#include <stdafx.h> 或者#include "stdio.h" 或不用试下.  编写的程序是C++ 语言来的
2016-05-20 11:19
wanglianyi1
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:14
帖 子:647
专家分:2067
注 册:2015-6-18
得分:6 
Cannot open include file: 'stdafx.h': No such file or directory
意思就是不能打开stdafx.h这个头文件,没有这个目录
2016-05-20 11:44
zhulei1978
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:53
帖 子:1351
专家分:1200
注 册:2006-12-17
得分:6 
Cannot open include file: 'stdafx.h': No such file or directory,
不能打开stdafx.h这个头文件,没有这个文件或者目录

其实我就是改变社会风气,提高少女素质,刺激电影市道,提高年轻人内涵,玉树临风,风度翩翩的整蛊专家,我名叫古晶,英文名叫JingKoo!
2016-05-20 13:22



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-465031-1-1.html




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

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