How to use PARAFORMAT

  • Thread starter Thread starter SamSpade
  • Start date Start date
S

SamSpade

I defined the struct as below.

When I try to asign a value to rgxTabs(0), I get an exception that rgxTabs
is null.

What more do I need to do??





public struct PARAFORMAT

{

public int cbSize;

public int dwMask;

public short wNumbering;

public short wReserved;

public int dxStartIndent;

public int dxRightIndent;

public int dxOffset;

public short wAlignment;

public short cTabCount;

[MarshalAs( UnmanagedType.ByValArray, SizeConst = 32 )] public int[]
rgxTabs; // MAX_TAB_STOPS

}
 
I think You need to use it in this way

PARAFORMAT pr = new PARAFORMAT();
pr.rgxTabs= new int[<Size>]; eg. pr.rgxTabs= new int[5];
then pr.rgxTabs[<index>]=<value> eg pr.rgxTabs[0]=1;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top