Re: Newbie Question



no it's not

It may be a problem but the compiler error clearly stated that he tried to
declare a method where only a class, delegate, enum, interface, or struct is
accepted.


cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"Mark R. Dawson" <MarkRDawson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7D63C04D-C17F-4ABB-A4AA-AF7102B5DD26@xxxxxxxxxxxxxxxx
> Hi Shmuel,
> do you have the type CHARFORMAT2 defined in you code or in a linked DLL,
> if not this might be the source of your problem.
>
> "S Shulman" wrote:
>
>> I added the following declaration withing a namespace but not within a
>> class
>>
>>
>> [DllImport("user32.dll", EntryPoint="SendMessage",
>> CharSet=CharSet.Auto )]
>>
>> public static extern int SendCharFmtMsg( IntPtr hWnd, int Msg, int
>> wParam,
>>
>> ref CHARFORMAT2 cf2 );
>>
>> And UI get the following compiler error
>> C:\Componenets\ABC\ABCColor\Class1.cs(11): Expected class, delegate,
>> enum,
>> interface, or struct
>>
>>
>> Thank you,
>> Shmuel Shulman
>>
>>
>>
>>
>>


.



Relevant Pages

  • Re: Trying to understand enums
    ... that's the name of the enum value. ... They are a way to declare new, ... constant types as an int. ... integer base type, it's true that you can do a lot of integer-like things   ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Trying to understand enums
    ... Enums aren't supposed to be a way to declare integer constants. ... If you want a constant typed as an int, then declare a constant types as an int. ... Because they are little more than a thin, type-safe veneer on top of an integer base type, it's true that you can do a lot of integer-like things with them, and of course can even cast to and from integer types. ...
    (microsoft.public.dotnet.languages.csharp)
  • Array of a type
    ... I have to do a program that determine the biggest ... I have to use enum ... so I was wondering can I declare an array of a type ... int h_rain_fall, n_months, i; ...
    (comp.lang.c)
  • Re: enum <name> : int {} - requires cast to int??
    ... > Of course if I cast int to it, then it compiles, but if I have declared the ... enum Foo: int is just syntactical sugar. ... It doesn't declare a true "int" subclass, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Enumerated types
    ... Enum ACGroup ... I cannot then access the members of the group. ... One alternative I could try, in the mean time, is to declare a string array ...
    (microsoft.public.access.formscoding)