now I put all this together in a mixed project(the code I have converted along side the original code) so I could debug as I was wtiting it, and the C++ version appeared to work when called from C#, however, I am now converting that calling code to C++ and it does not work anymore.
The calling code from C# is:
GetApplicationThreadCount(application.ApplicationId, out totalThreads, out unfinishedThreads);
totalThreads and unfinishedThreads are of type IntPtr, but when I try this, the compiler keeps telling me that I havent implemented this function yet, Im not sure but think something must be wrong in the implementation,but I am at a loss as to how to fix it.
I need the code to be callable from both C# and C++.
The % already expresses what the out keyword in C# does.
Also, I don't see any reason to use IntPtr in your post but maybe I missed something. Note that IntPtr and Int32 are only (more or less) equivalent in a 32-bit environment.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Alaska for the last 20 years, though I just moved back to CA
Posts
115
Re: Problem implementing an interface
No, this isnt for a com interface. I was just trying to make the code as exact to the C# code in c++ as I could since the C# code allready worked for the most part.
I have the signature in the interface and the implementation exactly as shown below, however, the compiler still says I dont have it implemented. Am I supposed to have virtual in both the interface and the implementation? do I need to follow the implementation with the override keyword? I tried all this with and without those keywords, I copied and pasted the interface code into the implementation definition just in case I mistyped something that I am not seeing but Im still at a loss.
Error C3766: 'Alchemi::Manager::Storage::InMemoryManagerStorage' must provide an implementation for the interface method
'void Alchemi::Core::Manager::Storage::IManagerStorage::GetApplicationThreadCount(System::String ^,int %,int %)' c:\programming\c++ version\working dir\mymanager\mymanager\MyManager.h 1302
Last edited by AKRichard; April 1st, 2011 at 08:34 AM.
Alaska for the last 20 years, though I just moved back to CA
Posts
115
Re: Problem implementing an interface
never mind, I just copied and pasted the definition from the interface to the implementation again and it worked, I must of screwed up the first time I did it.
Bookmarks