I have a C++ dll file which contains an exported function named fn(double* p, int* pLength), where, p is a pointer (is an out array used in C#), pLength which is calculated in this function is the length (size) of p . Code here:
void _stdcall fn(double* p, int* pLength)
I compile to dll file successfuly. This file is named "testFile.dll" and move it to System32 folder.
Now, I start C# console project and declare that exported function fn() from "testFile.dll", and this code is:
public static extern void fn(double p, ref int pLength);
static void Main(string args)
fn(p, ref pLength);
for (int i = 0; i < pLength; i++)
I run and get two errors:
Error 1 Use of unassigned local variable 'p'
Error 2 Use of unassigned local variable 'pLength'
How to fix them?, and I want to get pLength and p[i] fully from fn() function in "testFile.dll". Thanks in advance.