Re: Newbie Question
- From: "Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT dot.state.fl.us>
- Date: Fri, 14 Oct 2005 08:14:45 -0400
Hi,
It gave you a correct description of the problem, clear as water :)
It said that at that location only a class, delegate, enum, interface, or
struct can be declared, nothing more
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"S Shulman" <smshulman@xxxxxxxxxxx> wrote in message
news:O1dCfgL0FHA.664@xxxxxxxxxxxxxxxxxxxxxxx
>I had both problems and it is now OK
>
> I was wondering why the compiler gave me such a funny error
>
> Thanks,
> Shmuel
>
>
> "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
> wrote in message news:uyXSncL0FHA.3000@xxxxxxxxxxxxxxxxxxxxxxx
>> hi,
>>
>> you have to put it inside a class, in c# you cannot have global methods,
>> they need to be part of a class.
>>
>> cheers,
>>
>> --
>> Ignacio Machin,
>> ignacio.machin AT dot.state.fl.us
>> Florida Department Of Transportation
>>
>>
>> "S Shulman" <smshulman@xxxxxxxxxxx> wrote in message
>> news:eZEDaUL0FHA.3780@xxxxxxxxxxxxxxxxxxxxxxx
>>>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
>>>
>>>
>>>
>>>
>>
>>
>
>
.
- References:
- Newbie Question
- From: S Shulman
- Newbie Question
- Prev by Date: Newbie Question
- Next by Date: Re: Error...
- Previous by thread: Newbie Question
- Next by thread: Re: Newbie Question
- Index(es):
Relevant Pages
|