View Single Post
Old 10-20-2006, 07:15 AM   #1 (permalink)
tobyjug
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default 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:
Code:
error C3395: 'UltimaHelper::Gumps::GetGump' : __declspec(dllexport) cannot be applied to a function with the __clrcall calling convention
Here is my UltimaHelper.dll code in C++:
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;
        }

    };
}
Thanks for any help
__________________
David's Sig is my Sig. He always says it best.
tobyjug is offline   Reply With Quote