I hope someone can help. I’m new to Visual C++ 2008 and I just need help converting a program I wrote to a dll. Here's the program...

Code:
#include "stdafx.h"
#include <stdio.h>			
#include <tchar.h>
#include <iostream>			
#include <valarray>
			
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
// Define Variables
	char invalue[850] = "";
	char outvalue[] = "";
	unsigned int v=0;
	unsigned int vlen=0;
	

// Get in value		
	cin >> invalue;


// Setup Values of Variables 
	vlen = strlen(invalue);
	outvalue[0] = invalue[0];
	
// Loop
    for(v;v<vlen-1;v++)
    {						
	outvalue [0] ^=  invalue[v+1];   
	
    }

// Prints results
	printf ("%x \n", outvalue[0]); 

  
  return 0;

Basically it takes a sting like "AS0100012178 2178" and XOR's each character then takes the result and displays the hex value of the result (in this case should be 1e). In the dll though, i'll need it to output the hex value to the program i'm using. I've tried for two weeks and can't seem to figure out how a dll works completely.

Anyone think they can help me?! It would be greatly appreciated as I’m pulling my hair out!

Thanks!