Excuse me
My target is
to create a pointer at TestStand , then transfer this pointer into DLL that be built by Visual C++ , then dynamic memory allocation with C code
My action is:
I create a 'Custom Data Type' for "Pointer" type
Then
in StationGlobals of variable area , create a variable(name : ptr) that is "Pointer" type
DLL (source code)
=====================================================
#include<stdio.h>
#include<stdlib.h>
__declspec(dllexport) void Test_Empty_Array_into_DLL(double *array)
{
FILE *ptr=fopen("create_memory.txt","w+");
array=(double*)malloc(sizeof(double)*50);
int count;
for(count=0;count<50;count++)
{
array[count]=count*2;
fprintf(ptr,"%f\n",array[count]);
}
fclose(ptr);
}
====================================================
Yes, this result is OK(write some test's number into *.txt )
But , I don't know how to use those memory space that already be created on VisualC++ on teststand
I hope to use those space (array[50]) at TestStand
BTW. On TestStand platform , how to operate 'dynamic memory allocation '??
Pls give me some suggestion , thanks
best regards!
由 stockton 在
07-11-2008 02:51 AM 上編輯的訊息