谁可以帮我将以下C++程序译成C语言程序,谢谢喽!(本人没学过C++)
// 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;
}