Rick

Rick

  • NA
  • 1
  • 0

How to assign values to structure members defined in Static class?

Nov 28 2010 12:31 AM
I'm a beginner and I'm baffled.

Using VS2010 C#.

I added an existing .cs file to my project called MSFL.cs.

It contains a "public static class MSFL", within it a set of structures are defined. Here is one of those structures:

        [StructLayout( LayoutKind.Sequential, CharSet = CharSet.Ansi )]
        public struct MSFLSecurityInfo
        {
            public uint dwTotalSize;                            // Structure size
            public IntPtr hSecurity;                            // Security handle
            [MarshalAs( UnmanagedType.ByValTStr, SizeConst = MSFL_MAX_NAME_LENGTH + 1 )]
            public String szName;                               // Security name

            ... (snipped for brevity)

         }

In my main file called MainWindow.xaml.cs, within the "public partial class MainWindow : Window" section, I typed the following line in order to create a structure called SecInfo:

MSFL.MSFLSecurityInfo SecInfo = new MSFL.MSFLSecurityInfo();

Intellisense worked just fine when typing this in so I figured everything was referenced correctly.

However, when I try to access the members within the SecInfo structure using the DOT operator, intellisense does not detect my structure reference SecInfo, nor the members of the structure.

What might I be doing wrong?

TIA

Webbiz


Answers (1)