Click here to Skip to main content
15,912,400 members
Home / Discussions / C#
   

C#

 
AnswerRe: Getting the type from a string, any magic for this in C#? Pin
PIEBALDconsult5-Apr-09 5:24
mvePIEBALDconsult5-Apr-09 5:24 
QuestionHow to change the color of second line in RichText Box? Pin
Lijo Rajan4-Apr-09 22:23
Lijo Rajan4-Apr-09 22:23 
AnswerRe: How to change the color of second line in RichText Box? Pin
Xmen Real 4-Apr-09 23:11
professional Xmen Real 4-Apr-09 23:11 
GeneralRe: How to change the color of second line in RichText Box? Pin
Bit_flipper6-Feb-10 7:42
Bit_flipper6-Feb-10 7:42 
Questionproblem in using namespaces Pin
yogesh_softworld1234-Apr-09 22:07
yogesh_softworld1234-Apr-09 22:07 
AnswerRe: problem in using namespaces Pin
Luc Pattyn4-Apr-09 22:49
sitebuilderLuc Pattyn4-Apr-09 22:49 
AnswerRe: problem in using namespaces Pin
ramz_g8-Apr-09 19:49
ramz_g8-Apr-09 19:49 
Questionproblem to importing DLL files Pin
cppwxwidgetsss4-Apr-09 21:35
cppwxwidgetsss4-Apr-09 21:35 
i have a form, i want to change the time and/or date of the system
and now i have found the following code but it just generate errors
i don't know what is exactly the problem
it is not a run time error, it is a compilation error
i am using C# in visual studio 2008
here is the error message :

"Error 39  Attribute 'StructLayout' is not valid on this declaration type. It is only valid on 'class, struct' declarations.   D:\visual studio projects\firstCSharp\firstCSharp\settings.cs   16  12  firstCSharp"


here is the code

public partial class settings : Form
    {
          [StructLayout(LayoutKind.Sequential)]
        [DllImport("kernel32.dll", EntryPoint = "SetSystemTime", SetLastError = true)]

        private static extern bool SetSystemTime(ref MyDateTime st);



        [DllImport("kernel32.dll", EntryPoint = "GetSystemTime", SetLastError = true)]

        private extern static void GetSystemTime(ref MyDateTime sysTime);

please tell me how can i handle this error
thank you everybody in Advance
AnswerRe: problem to importing DLL files Pin
Luc Pattyn4-Apr-09 22:54
sitebuilderLuc Pattyn4-Apr-09 22:54 
GeneralRe: problem to importing DLL files Pin
PIEBALDconsult5-Apr-09 4:14
mvePIEBALDconsult5-Apr-09 4:14 
QuestionSeparator Line on form.....help guys! Pin
Rajdeep.NET is BACK4-Apr-09 21:21
Rajdeep.NET is BACK4-Apr-09 21:21 
AnswerRe: Separator Line on form.....help guys! Pin
Harvey Saayman4-Apr-09 22:02
Harvey Saayman4-Apr-09 22:02 
GeneralRe: Separator Line on form.....help guys! Pin
Rajdeep.NET is BACK4-Apr-09 22:13
Rajdeep.NET is BACK4-Apr-09 22:13 
GeneralRe: Separator Line on form.....help guys! Pin
Rajdeep.NET is BACK4-Apr-09 22:16
Rajdeep.NET is BACK4-Apr-09 22:16 
GeneralRe: Separator Line on form.....help guys! Pin
Luc Pattyn4-Apr-09 22:59
sitebuilderLuc Pattyn4-Apr-09 22:59 
AnswerRe: Separator Line on form.....help guys! Pin
#realJSOP5-Apr-09 3:07
professional#realJSOP5-Apr-09 3:07 
QuestionOk, is it just me or...? Pin
jas0n234-Apr-09 20:26
jas0n234-Apr-09 20:26 
AnswerRe: Ok, is it just me or...? Pin
hot_ice4-Apr-09 20:39
hot_ice4-Apr-09 20:39 
GeneralRe: Ok, is it just me or...? Pin
jas0n234-Apr-09 20:42
jas0n234-Apr-09 20:42 
AnswerRe: Ok, is it just me or...? Pin
DaveyM694-Apr-09 22:16
professionalDaveyM694-Apr-09 22:16 
AnswerRe: Ok, is it just me or...? Pin
Luc Pattyn4-Apr-09 23:02
sitebuilderLuc Pattyn4-Apr-09 23:02 
AnswerRe: Ok, is it just me or...? Pin
Christian Graus5-Apr-09 0:01
protectorChristian Graus5-Apr-09 0:01 
GeneralRe: Ok, is it just me or...? Pin
jas0n235-Apr-09 0:05
jas0n235-Apr-09 0:05 
AnswerRe: Ok, is it just me or...? Pin
#realJSOP5-Apr-09 3:09
professional#realJSOP5-Apr-09 3:09 
AnswerRe: Ok, is it just me or...? Pin
PIEBALDconsult5-Apr-09 5:39
mvePIEBALDconsult5-Apr-09 5:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.