Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   Please help me to convert thisC# Code into VC++. (http://www.go4expert.com/forums/help-convert-thisc-sharp-code-vcpp-t16004/)

nnhamane 30Jan2009 16:41

Please help me to convert thisC# Code into VC++.
 
Code:

//Code

private static void AddExtension(ReportViewer viewer, string name, Type extensionType)
{
    const BindingFlags Flags = BindingFlags.NonPublic |
          BindingFlags.Public | BindingFlags.Instance;
    FieldInfo previewService =
      viewer.LocalReport.GetType().GetField("m_previewService", Flags);
    MethodInfo ListRenderingExtensions =
      previewService.FieldType.GetMethod("ListRenderingExtensions", Flags);
    IList extensions = ListRenderingExtensions.Invoke(
      previewService.GetValue(viewer.LocalReport), null) as IList;
    Type localRenderingExtensionInfoType = Type.GetType(
        "Microsoft.Reporting.LocalRenderingExtensionInfo, " +
        "Microsoft.ReportViewer.Common," +
        "Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
    ConstructorInfo ctor = localRenderingExtensionInfoType.GetConstructor(
        Flags, null, new Type[] { typeof(string), typeof(string),
        typeof(bool), typeof(Type), typeof(bool) }, null);
    object instance =
      ctor.Invoke(new object[] { name, name, true, extensionType, true });
    extensions.Add(instance);
}
//End Of Code


shabbir 30Jan2009 17:41

Re: Please help me to convert thisC# Code into VC++.
 
Duplicate of Please help me to convert this C# Code into VC++.. Thread closed.


All times are GMT +5.5. The time now is 15:57.