I have a library a friend wrote in C# and I need to use it in C++.NET. I'm new to VC++.NET and I don't know how to declare my class so it can be used by all functions in my file.. Here's my code..
using namespace System;
using namespace ONEAPI;
namespace Bot{
void InitializeBot();
ONEAPI::Connection connection(true);
int main(array<System::String ^> ^args)
{
Console::BackgroundColor = ConsoleColor::Black;
InitializeBot();
return 0;
}
void InitializeBot(){
connection.StartConnection("127.0.0.1", 1274, "username",
"B73955EE7A30E959819BAE2392F6F4441DF98C66A4026EF55287A81D1F815504",
"R0Bo");
}
}
I get this error:
Error 1 error C3145: 'connection' : global or static variable may not have managed type 'ONEAPI::Connection' Visual Studio 2010\Projects\1hubBot\1hubBot\1hubBot.cpp 10 1 1hubBot
{}. All it's doing is indenting each line with 4 spaces--that's what the formatting engine uses to detect code blocks.