I have an AA TREE c++ implementation source code and I need to put that code into a Win32 c++ : <p>I have an assignment to make a real application of AA tree. For now I have only the console application format and I can't convert into win32 project. I work in visual studio 2015. The teacher didn't bring us any content to learn just told us to to do it. Would you help me please? This is the code for console application :</p>

<pre><code> * C++ Program To Implement AA Tree
 */
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;cstring&gt;
#include &lt;fstream&gt;
using namespace std;
/*
 * Node Declaration
 */
struct node
{
    int count, level;
    string key; 
    node *right;
    node *left;
    node *parent;
    node *root;
}*root;
 
/*
 * Class Declaration
 */
class AATree
{
    public:
        int lookup(string &amp;);
        void skew(node *);
        bool split(node *);
        void rebal(node *);
        node *insert(node *,node *);
        void print(node *);
        int countnode(node *);
        AATree()
    {
            root = NULL;
        }
};
 
/*
 * Main: Contains Menu
 */
int main()
{
    AATree at;
    int ch;
    string x;
    ifstream fin ("test.txt");
    while (1)
    {
        cout&lt;&lt;"\n---------------------"&lt;&lt;endl;
        cout&lt;&lt;"\nOperations on AA Tree"&lt;&lt;endl;
        cout&lt;&lt;"\n---------------------"&lt;&lt;endl;
        cout&lt;&lt;"1.Insert String into the Tree"&lt;&lt;endl;
        cout&lt;&lt;"2.Print Tree Data"&lt;&lt;endl;
        cout&lt;&lt;"3.Total Tree Nodes"&lt;&lt;endl;
        cout&lt;&lt;"4.Exit"&lt;&lt;endl;
        cout&lt;&lt;"Enter Your Choice: ";
        cin&gt;&gt;ch;
        switch (ch)
        {
        case 1:
            if (fin.is_open())
            {
                while (fin&gt;&gt;x)
                {
                    at.lookup(x);
                }
                fin.close();
            }
        break;
        case 2:
            cout&lt;&lt;"Elemets of AA Tree"&lt;&lt;endl;
            at.print(root);
            break;
        case 3:
            cout&lt;&lt;"Total number of nodes"&lt;&lt;endl;
            cout&lt;&lt;at.countnode(root)&lt;&lt;endl;
            break;
        case 4:
            cout&lt;&lt;"Exiting"&lt;&lt;endl;
            exit(1);
            break;
        default:
            cout&lt;&lt;"Wrong Choice"&lt;&lt;endl;
        }
    }
    return 0;
}
/*
 * Insert String into the Tree
 */
int AATree::lookup(string &amp;key)
{
    node *temp = new node;
    temp-&gt;key = key;
    temp-&gt;level = 1;
    temp-&gt;count = 0;
    temp-&gt;left = NULL;
    temp-&gt;right = NULL;
    temp-&gt;parent = NULL;
    temp = insert(root, temp);
    return temp-&gt;count;
}
 
/*
 * Skew Tree
 */
 
void AATree::skew(node *temp)
{
    node *ptr = temp-&gt;left;
    if (temp-&gt;parent-&gt;left == temp)
        temp-&gt;parent-&gt;left = ptr;
    else
        temp-&gt;parent-&gt;right = ptr;
    ptr-&gt;parent = temp-&gt;parent;
    temp-&gt;parent = ptr;
    temp-&gt;left = ptr-&gt;right;
    if (temp-&gt;left != NULL)
        temp-&gt;left-&gt;parent = temp;
    ptr-&gt;right = temp;
    temp-&gt;level = (temp-&gt;left ? temp-&gt;left-&gt;level + 1 : 1);
}
 
/*
 * Splitting of AA Tree
 */
bool AATree::split(node *temp)
{
    node* ptr = temp-&gt;right;
    if (ptr &amp;&amp; ptr-&gt;right &amp;&amp; (ptr-&gt;right-&gt;level == temp-&gt;level))
    {
        if (temp-&gt;parent-&gt;left == temp)
            temp-&gt;parent-&gt;left = ptr;
        else
            temp-&gt;parent-&gt;right = ptr;
        ptr-&gt;parent = temp-&gt;parent;
        temp-&gt;parent = ptr;
        temp-&gt;right = ptr-&gt;left;
        if (temp-&gt;right != NULL)
            temp-&gt;right-&gt;parent = temp;
        ptr-&gt;left = temp;
        ptr-&gt;level = temp-&gt;level + 1;
        return true;
    }
    return false;
}
 
/*
 * Rebalancing of AA Tree
 */
void AATree::rebal(node* temp)
{
    temp-&gt;left = NULL;
    temp-&gt;right = NULL;
    temp-&gt;level = 1;
    for (temp = temp-&gt;parent; temp != root; temp = temp-&gt;parent)
    {
        if (temp-&gt;level != (temp-&gt;left ? temp-&gt;left-&gt;level + 1 : 1 ))
        {
            skew(temp);
            if (temp-&gt;right == NULL)
                temp = temp-&gt;parent;
            else if (temp-&gt;level != temp-&gt;right-&gt;level)
                temp = temp-&gt;parent;
        }
        if (temp-&gt;parent != root)
        {
            if (split(temp-&gt;parent) == false)
                break;
        }
    }
}
 
/*
 * Insert Function to insert string into the tree
 */
node* AATree::insert(node* temp, node* ins)
{
    if (root == NULL)
    {
        ins-&gt;count = 1;
        ins-&gt;parent = NULL;
        ins-&gt;left = NULL;
        ins-&gt;right = NULL;
        root = ins;
        return root;
    }
    if (ins-&gt;key &lt; temp-&gt;key)
    {
        if (temp-&gt;left)
            return insert(temp-&gt;left, ins);
        temp-&gt;left = ins;
        ins-&gt;parent = temp;
        ins-&gt;count = 1;
        rebal(ins);
        return ins;
    }
    if (ins-&gt;key &gt; temp-&gt;key)
    {
        if (temp-&gt;right)
            return insert(temp-&gt;right, ins);
        temp-&gt;right = ins;
        ins-&gt;parent = temp;
        ins-&gt;count = 1;
        rebal(ins);
        return ins;
    }
    temp-&gt;count++;
    delete ins;
    return temp;
}
 
/*
 * Display Tree Elements
 */
void AATree::print(node* temp)
{
    if (!temp)
        return;
    print(temp-&gt;left);
    cout &lt;&lt;"Value: "&lt;&lt;temp-&gt;key &lt;&lt; "  Count:" &lt;&lt; temp-&gt;count;
    cout&lt;&lt;"  Level: "&lt;&lt;temp-&gt;level&lt;&lt;endl;
    print(temp-&gt;right);
}
 
/*
 * Count number of nodes in AA Tree
 */
int AATree::countnode(node* temp)
{
    if (!temp)
        return 0;
    int count = 1;
    count = count + countnode(temp-&gt;left);
    count = count + countnode(temp-&gt;right);
    return count;
}
</code></pre>
