Requirement


How to do

* Step1 : install WinGraphviz first

* Step2 : Download the WinGraphviz.h File

* Step3 : Copy the following code and save it in test.cpp

#include <atlbase.h>
#include <iostream.h>
#include "WinGraphviz.h"

const IID IID_IDOT = {0xA1080582,0xD33F,0x486E,{0xBD,0x5F,0x58,0x19,0x89,0xA3,0xC7,0xE9}};
						
const CLSID CLSID_DOT = {0x55811839,0x47B0,0x4854,{0x81,0xB5,0x0A,0x00,0x31,0xB8,0xAC,0xEC}};

int main(int argc, char* argv[])
{
	USES_CONVERSION;
	HRESULT hr;
	IDOT * pIDOT;
	CComBSTR result;

	hr = CoInitialize(NULL);

	if (FAILED(hr)) {
		cout << "CoInitialize Failed: " << hr << "\n\n";
		exit(1);
	}
	else {
		cout << "CoInitialize succeeded\n";
	}
		
	hr = CoCreateInstance(CLSID_DOT, NULL, CLSCTX_ALL, 
	  IID_IDOT, reinterpret_cast(&pIDOT));

	if (FAILED(hr)) {
	  cout << "CoCreateInstance Failed: " << hr << "\n\n";
	  ;
	}
	else {
	  cout << "CoCreateInstance succeeded\n";
	}
		
	hr = pIDOT->ToSvg(A2BSTR("digraph G {A -> B -> C -> A;}"),&result);

	if (FAILED(hr)) {
	  cout << "ToSvg Failed: " << hr << "\n\n";
	  ;
	}
	else {
	  cout << "ToSvg succeeded\n";
	}

	MessageBox(NULL,OLE2T(result) , _T("DOT.ToSvg"), MB_OK);
	
	
	CoUninitialize();
	return 0;
};
	

* Step3 : Complie and test it


Feedback

Submit bug reports or suggestions for the WinGraphviz ood Tsen.