Using dllexport on a function with the __clrcall convention
Hi there, I'm pretty new to using C++ after using C# for a while now and so the syntax and that is pretty similar...
Anyway what I am trying to do is make a DLL in C++ that will interact with the Ultima.dll. I want to do this because I am writing a form that runs from within the runuo server and so it is impossible to add Ultima.dll as a reference and Ultima.dll doesn't export it's functions so I can't use dllimport in my C# code of my form. So basically I'm writing my C++ DLL that has a reference to Ultima.dll in it and then I am writing functions in my C++ dll to export bitmaps created using the functions from Ultima.dll.
However I'm having a problem with exporting my functions from my C++ dll because of the following error:
Here is my UltimaHelper.dll code in C++:
Thanks for any help
Hi there, I'm pretty new to using C++ after using C# for a while now and so the syntax and that is pretty similar...
Anyway what I am trying to do is make a DLL in C++ that will interact with the Ultima.dll. I want to do this because I am writing a form that runs from within the runuo server and so it is impossible to add Ultima.dll as a reference and Ultima.dll doesn't export it's functions so I can't use dllimport in my C# code of my form. So basically I'm writing my C++ DLL that has a reference to Ultima.dll in it and then I am writing functions in my C++ dll to export bitmaps created using the functions from Ultima.dll.
However I'm having a problem with exporting my functions from my C++ dll because of the following error:
Code:
error C3395: 'UltimaHelper::Gumps::GetGump' : __declspec(dllexport) cannot be applied to a function with the __clrcall calling convention
Code:
#pragma once
using namespace System;
using namespace Ultima;
namespace UltimaHelper
{
public class __declspec(dllexport) Gumps
{
public: static System::Drawing::Bitmap^ GetGump(int index)
{
System::Drawing::Bitmap^ returnImage = Ultima::Gumps::GetGump(index);
return returnImage;
}
};
}