c# - Reading Variable (array of structs) out of unmanaged dll -


I need your help.

I have the following code code: a DLL (Can not recompile or change it):

  typedef struct {/ * test name * / four * name; / * Trial name (his call name) * / four * snack; / * Indicator * / char * description for a test description; / * Standard test default * / unsigned int psamples_std; / * Standard test default * / unsigned int tsamples_std; / * Number of independent statistics generated per points * / unsigned int NKPS; / * An indicator for testing itself (should be filled on initialization) * / int (* test); / * Zero Pointer * / Zero * targs for a vector of additional test arguments; } Dtest;   

This structure is used in DLL inside an array, as you can see here:

  Dtest * dh_test_types [1000]; After a lot of research, I found a way to get "simple type" varibales out of DLL:  
  IntPtr hdl; HDL = Load Library ("SagadiHarder-3D"); IntPtr addr = GetProcAddress (HDL, "dh_test_types");   

and for the simple types I use

  int value = martial. Readin 32 (asp);   

But I can not get any information about the array of "dotest" structures within the URL because there is nothing like martial. rreddest (ADR)

It would be great if someone could help me.

Thank you in anticipation

Given that your structure is described above, And variables:

  Dtest * dh_test_types [1000];   

is defined by that typeface, then an array of straight (with 100 elements) that pointer can be accessed:

  Dh_test_types [0] - & gt; Name; dh_test_types [0] - & gt; SNAME; dh_test_types [0] - & gt; Description; Dh_test_types [0] - & gt; Psamples_std; Dh_test_types [0] - & gt; SNAME; Dh_test_types [0] - & gt; targs; Dh_test_types [0] - & gt; testing; Dh_test_types [0] - & gt; Tsamples_std; // ... the rest of the index ... dh_test_types [99] - & gt; Name; Dh_test_types [99] - & gt; SNAME; Dh_test_types [99] - & gt; Description; Dh_test_types [99] - & gt; psamples_std; Dh_test_types [99] - & gt; SNAME; dh_test_types [99] - & gt; targs; dh_test_types [99] - & gt; testing; dh_test_types [99] - & gt; Tsamples_std;   

And everything in between

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -