Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

What is wrong with this code - 'ArgOutValueArray(int (__gc* __nogc& aRef) __gc[] )'

$
0
0

We have a VC++ project for CLR which is compiling properly in VS 2012. But getting the following exception during runtime:

"Could not load type 'System.Int32[]&' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'"

Following is the code:

------------------------------------------------------------

// ClassLibrary1.h

#pragma once

using namespace System;
using namespace System::Runtime::InteropServices;

namespace ClassLibrary1 {

 //template <typename T>
    class ArgOutValueArray
    {
    public:
        ArgOutValueArray(int (__gc* __nogc& aRef) __gc[] )
        {
            //(*x)[0] = 100;
        }

       };


 public __gc class Class1
 {
  
  public:

              static void f1([Out] int (*x) __gc[])
              {
                    f2(x);
              }

     static void f2([Out] int (*x) __gc[])
     {
       ArgOutValueArray arg_xeqp(x); // Getting the exception at this line.
     }

 };
}

-------------------------------------------------------------------


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>