Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everybody!

I'm using Visual C++ 2008 and I've done problem "finding hamilton cycle in an undirected graph" after writing a console application.
I want improve the program to a window form application and I have 2 missions to complete:
1. How to read an adjacency matrix from a rich text box to an array of integers.
2. How to draw a graph with vertices and edges between them. I need a guide book to read and follow.

May someone get me started?
Thank you in advanced!
Posted
Updated 28-Jan-11 20:05pm
v2

1 solution

I assume that by Form you mean that you are considering to use C++/CLI and .Net.

I'd advice you to use WPF since the graphics will be much easier to implement.

use something like this to parse input (in C#)
string s = "1,2,3,4,5,6";
string[] arrayOfStrings = s.Split(',');


Use C++/CLI to create a .Net .dll assembly for your existing C++ code.

Here is a series showing much of what you need to know to render your graph:
WPF Diagram Designer - Part 4[^]

Regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 29-Jan-11 23:07pm    
Espen, I voted 5 despite of MFC tag. First, this tag could be a mistake, secondly it's advisable that OP switches to WPF and C++/CLI.
--SA
Espen Harlinn 30-Jan-11 4:36am    
WFC was meant as an advice. He writes about Windows Forms - so I guess the MFC tag is wrong.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900