// ATLCon.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

using namespace RedcoalMessaging;

int main(int argc, char* argv[])
{
  HRESULT hresult;
  CLSID clsid;
  CoInitialize(NULL);	//initialize COM library
  hresult=CLSIDFromProgID(OLESTR("RedcoalMessaging.SMSService"),&clsid);

  ISMSService *t;
  hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_SMSSvr44),(LPVOID *) &t);

  if(FAILED(hresult))
  {
   //MessageBox(_T("Creation Failed"),"COM Client",MB_OK | MB_ICONEXCLAMATION);
   return 0;
  }

  double bl,mR;
  mR=t->GetCredits(L"CE6981",&bl);

  CoUninitialize();  //Unintialize the COM library

  cout<<"Server :" <<mR<<" , Stefan's Credits : "<<bl<<endl;
  return 0;
}