首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

怎么把下面的C++代码写成C#代码

2012-04-05 
如何把下面的C++代码写成C#代码?C/C++ code#include stdafx.h#include Inventor\Win\SoWin.h#include

如何把下面的C++代码写成C#代码?

C/C++ code
#include "stdafx.h"#include <Inventor\Win\SoWin.h>#include <Inventor\Win\viewers\SoWinExaminerViewer.h>#include <Inventor\nodes\SoCube.h>#include <Inventor\nodes\SoDirectionalLight.h>#include <Inventor\nodes\SoMaterial.h>#include <Inventor\nodes\SoPerspectiveCamera.h>#include <Inventor\nodes\SoSeparator.h>int main(int argc, char **argv){         HWND myWindow = SoWin::init(argv[0]);         if (myWindow == NULL)    exit(1);                 SoSeparator *root = new SoSeparator;         root->ref();         SoMaterial *myMaterial = new SoMaterial;         myMaterial->diffuseColor.setValue(1.0, 0.0, 0.0);         root->addChild(myMaterial);         root->addChild(new SoCube);                 SoWinExaminerViewer *myViewer = new SoWinExaminerViewer(myWindow);         myViewer->setSceneGraph(root);         myViewer->setTitle("Examiner Viewer");         myViewer->show();                 SoWin::show(myWindow);         SoWin::mainLoop();                 return 0;}


[解决办法]
那么多头文件谁知道做啥用的
[解决办法]
太扯了,很多都是非标准的东西,人家自定义的,你怎么翻译,你这代码 差的东西多了
[解决办法]
Open Inventor 貌似也支持 .net
[解决办法]
C# code
using OIV.Inventor.Win;using OIV.Inventor.Win.Viewers;using OIV.Inventor.Nodes;class program{   static void main(string[] args){
[解决办法]
得自己写命名空间啊?
还不如,把include的东西都作为成员函数

热点排行