C++ invoke the method of a C# DLL. but C++ get a delegate method from the C# DLL, not the result that should be.
my question is: how C++ deal with the C# delegate method? as the picture shows, "output" variable accepts the result. but it's a method. does anybody know this case? what should I do?
Code:
output = selectedMethod->Invoke(instance, gcnew array<System::Object^>(1){ tmpObj1 });
System::Type^ typeOfOutput = output->GetType();
Watch:
-output0x000000200fa437b0System::Object^-[HPFS::IDS::OrganizationMaster::Processors::RplStatusProcess::<GetFromIds>d__3^]0x000000200fa437b0HPFS::IDS::OrganizationMaster::Processors::RplStatusProcess::<GetFromIds>d__3^
System::Object^0x000000200fa437b0System::Object^
<>1__state-2int
<>2__current<undefined value>HPFS::MasterData::Organization::Model::RplStatus^
+<>3__otherPartySiteInstanceIds0x000000200fa348e0System::Collections::Generic::List<__int64>^
-<>4__this0x000000200fa43798HPFS::IDS::OrganizationMaster::Processors::RplStatusProcess^
System::Object^0x000000200fa43798System::Object^
+CS$<>9__CachedAnonymousMethodDelegate2<class not loaded>System::Func^
+CS$<>9__CachedAnonymousMethodDelegated<class not loaded>System::Func^
+CreateTransactionScope0x000000200fa43758System::Func<System::Transactions::TransactionScope^>^
MaxNumberOfCharsForStreetInGtsService60int
<>7__wrap7<undefined value>System::Collections::Generic::IEnumerator<__int64>^
<>l__initialThreadId1int
<lmd>5__4<class not loaded>
<otherPartySiteInstanceId>5__50__int64
System.Collections.Generic.IEnumerator<HPFS.MasterData.Organization.Model.RplStatus>.Current<undefined value>HPFS::MasterData::Organization::Model::RplStatus^
System.Collections.IEnumerator.Current<undefined value>System::Object^
otherPartySiteInstanceIds<undefined value>System::Collections::Generic::IEnumerable<__int64>^
result<undefined value>NodeLibWrapper::ExitMessage^
-typeOfOutput0x000000200f925bd0System::Type^
+[System::RuntimeType^]0x000000200f925bd0 { m_cachedData=<undefined value> m_keepalive=<undefined value> m_cache=0 ...}System::RuntimeType^
+System::Reflection::MemberInfo^0x000000200f925bd0System::Reflection::MemberInfo^
+Assembly0x000000200f9259e0System::Reflection::Assembly^
AssemblyQualifiedName"HPFS.IDS.OrganizationMaster.Processors.RplStatusProcess+<GetFromIds>d__3, HPFS.IDS.OrganizationMaster, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"System::String^
Attributes
1048835System::Reflection::TypeAttributes
+BaseType0x000000200f923230System::Type^
ContainsGenericParametersfalsebool
DeclaredOnlyLookuperror: cannot obtain valueSystem::Reflection::BindingFlags
+DeclaringMethod<error: an exception of type: System::InvalidOperationException^ occurred>System::Reflection::MethodBase^
+DeclaringType0x000000200f925b60System::Type^
+DefaultBinder0x000000200f947350System::Reflection::Binder^
DefaultLookup
error: cannot obtain valueSystem::Reflection::BindingFlags
Delimiter
46 L'.'wchar_t
EmptyTypes
{Length=0}array<System::Type^> ^
+FilterAttribute0x000000200f947258System::Reflection::MemberFilter^
+FilterName0x000000200f947298System::Reflection::MemberFilter^
+FilterNameIgnoreCase0x000000200f9472d8System::Reflection::MemberFilter^
FullName"HPFS.IDS.OrganizationMaster.Processors.RplStatusProcess+<GetFromIds>d__3"System::String^
+GUID
{ _a=-1469425693 _b=-13508 ...}System::Guid
GenericParameterAttributes<error: an exception of type: System::InvalidOperationException^ occurred>System::Reflection::GenericParameterAttributes
GenericParameterPosition<error: an exception of type: System::InvalidOperationException^ occurred>int
GenericTypeArguments{Length=0}array<System::Type^> ^
HasElementTypefalsebool
HasProxyAttributefalsebool
IsAbstract
falsebool
IsAnsiClass
truebool
IsArray
falsebool
IsAutoClass
falsebool
IsAutoLayout
truebool
IsByRef
falsebool
IsCOMObject
falsebool
IsClass
truebool
IsConstructedGenericTypefalsebool
IsContextful
falsebool
IsEnum
falsebool
IsExplicitLayoutfalsebool
IsExportedToWindowsRuntimefalsebool
IsGenericParameterfalsebool
IsGenericType
falsebool
IsGenericTypeDefinitionfalsebool
IsImport
falsebool
IsInterface
falsebool
IsLayoutSequentialfalsebool
IsMarshalByReffalsebool
IsNested
truebool
IsNestedAssemblyfalsebool
IsNestedFamANDAssemfalsebool
IsNestedFamORAssemfalsebool
IsNestedFamilyfalsebool
IsNestedPrivatetruebool
IsNestedPublicfalsebool
IsNotPublic
falsebool
IsPointer
falsebool
IsPrimitive
falsebool
IsPublic
falsebool
IsSealed
truebool
IsSecurityCriticaltruebool
IsSecuritySafeCriticalfalsebool
IsSecurityTransparentfalsebool
IsSerializablefalsebool
IsSpecialName
falsebool
IsSzArray
falsebool
IsUnicodeClassfalsebool
IsValueType
falsebool
IsVisible
falsebool
IsWindowsRuntimeObjectfalsebool
MemberType
System::Reflection::MemberTypes::NestedType
System::Reflection::MemberTypes
+Missing
0x000000200f947318System::Object^
+Module
0x000000200f925a40System::Reflection::Module^
Namespace"HPFS.IDS.OrganizationMaster.Processors"
System::String^
NeedsReflectionSecurityChecktruebool
+ReflectedType0x000000200f925b60System::Type^
+StructLayoutAttribute0x000000200fa45750 { _val=System::Runtime::InteropServices::LayoutKind::Auto Pack=8 Size=0 ...}System::Runtime::InteropServices::StructLayoutAttribute^
+TypeHandle{ m_type=0x000000200f925bd0 }System::RuntimeTypeHandle
TypeInitializer<undefined value>System::Reflection::ConstructorInfo^
+UnderlyingSystemType0x000000200f925bd0System::Type^
+defaultBinder0x000000200f947350System::Reflection::Binder^