Iím practicing network programming in C++ .Net. I figured a simple yahoo messenger login application would be a fun way to do this. Every example online is written in Visual Basic. I cannot find anything pertaining to yahoo chat, written in C++.
I found a really good example written in VB .NET which works. The example utilizes a .dll file for encrypting the username and password when logging into yahoo messenger. Below it the Visual Basic example of this function prototype.
This is my attempt at recreating this in C++.Net. I make a bogus call to the ďYMSG12_ScriptedMind_EncryptĒ function for testing purposes only.#Region "Private Externally Referenced Functions"
Private Declare Function YMSG12_ScriptedMind_Encrypt Lib "YMSG12ENCRYPT.DLL" (ByVal username As String, ByVal password As String, ByVal Seed As String, ByVal result_6 As String, ByVal result_96 As String, ByVal intt As int32) As Boolean
When I run this code I get this error#include "stdafx.h"
using namespace YAHOOLOGINC;
using namespace std;
typedef bool (WINAPI*cfunc)(std::string username, std::string password,
std::string Seed, std::string result_6,
std::string result_96, int intt);
int main(array<System::String ^> ^args)
// Enabling Windows XP visual effects before any controls are created
HINSTANCE hMod = LoadLibrary("YMSG12ENCRYPT.DLL");
MessageBox::Show("Unable to load dll");
//test call to the dll
bool test = YMSG12_ScriptedMind_Encrypt("hdhd", "dgdf", " ", " ", " ", 7);
// Create the main window and run it
An unhandled exception of type 'System.AccessViolationException' occurred in YAHOOLOGINC++.exe
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Iím not sure if this .dll can be used in a C++ app or if this has something to do with the CheckForIllegalCrossThreadCalls being set to true by defualt in VS 2005
I have attached a copy of this .dll file (YMSG12ENCRYPT.dll) and the VB.NET example.