Click here to Skip to main content
15,887,346 members
Home / Discussions / C#
   

C#

 
Questionnumbers in words in crystal report Pin
Enobong Adahada30-Sep-09 2:45
Enobong Adahada30-Sep-09 2:45 
Questionlandscape page in crystal report Pin
Enobong Adahada30-Sep-09 2:40
Enobong Adahada30-Sep-09 2:40 
QuestionHow to read a message of class IPM.Note.SMIME.MultipartSigned in c# using CDO Pin
Nitesh Malik30-Sep-09 2:39
Nitesh Malik30-Sep-09 2:39 
QuestionHow to translate Win32 error codes Pin
Jörgen Sigvardsson30-Sep-09 2:00
Jörgen Sigvardsson30-Sep-09 2:00 
AnswerRe: How to translate Win32 error codes Pin
stancrm30-Sep-09 2:04
stancrm30-Sep-09 2:04 
GeneralRe: How to translate Win32 error codes Pin
Jörgen Sigvardsson30-Sep-09 2:08
Jörgen Sigvardsson30-Sep-09 2:08 
GeneralRe: How to translate Win32 error codes Pin
Martijn van Kleef8-Dec-10 22:53
Martijn van Kleef8-Dec-10 22:53 
AnswerRe: How to translate Win32 error codes Pin
Luc Pattyn30-Sep-09 2:11
sitebuilderLuc Pattyn30-Sep-09 2:11 
Hi,

you can use a little P/Invoke to access FormatMessage, this is the code I normally use:
using System.Runtime.InteropServices;		// DllImport

public static string GetSystemMessage(int errorCode) {
	int capacity = 512;
	int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
	StringBuilder sb = new StringBuilder(capacity);
	FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, IntPtr.Zero, errorCode, 0,
		sb, sb.Capacity, IntPtr.Zero);
	int i = sb.Length;
	if (i>0 && sb[i - 1] == 10) i--;
	if (i>0 && sb[i - 1] == 13) i--;
	sb.Length = i;
	return sb.ToString();
}

[DllImport("kernel32.dll")]
public static extern int FormatMessage(int dwFlags, IntPtr lpSource, int dwMessageId,
	int dwLanguageId, StringBuilder lpBuffer, int nSize, IntPtr Arguments);


Smile | :)

Luc Pattyn

Local announcement (Antwerp region): Lange Wapper? Neen!


GeneralRe: How to translate Win32 error codes Pin
Jörgen Sigvardsson30-Sep-09 2:13
Jörgen Sigvardsson30-Sep-09 2:13 
GeneralRe: How to translate Win32 error codes Pin
Luc Pattyn30-Sep-09 2:20
sitebuilderLuc Pattyn30-Sep-09 2:20 
QuestionProblem In Window Services in C# Pin
Anudeep Jaiswal - MCA30-Sep-09 1:34
Anudeep Jaiswal - MCA30-Sep-09 1:34 
AnswerRe: Problem In Window Services in C# Pin
SeMartens30-Sep-09 1:44
SeMartens30-Sep-09 1:44 
QuestionHow to load entity properties conditionally Pin
Vikas Misra(TCS)30-Sep-09 1:24
Vikas Misra(TCS)30-Sep-09 1:24 
QuestionHow Can I Create Printer Pin
Anubhava Dimri30-Sep-09 1:00
Anubhava Dimri30-Sep-09 1:00 
AnswerRe: How Can I Create Printer Pin
Wes Aday30-Sep-09 1:13
professionalWes Aday30-Sep-09 1:13 
AnswerRe: How Can I Create Printer Pin
Richard MacCutchan30-Sep-09 1:14
mveRichard MacCutchan30-Sep-09 1:14 
Questionfile can be write on XP but can not on VISTA Pin
khosnur30-Sep-09 0:46
khosnur30-Sep-09 0:46 
AnswerRe: file can be write on XP but can not on VISTA Pin
Calla30-Sep-09 1:01
Calla30-Sep-09 1:01 
GeneralRe: file can be write on XP but can not on VISTA Pin
khosnur30-Sep-09 1:07
khosnur30-Sep-09 1:07 
GeneralRe: file can be write on XP but can not on VISTA Pin
Calla30-Sep-09 1:21
Calla30-Sep-09 1:21 
GeneralRe: file can be write on XP but can not on VISTA Pin
khosnur30-Sep-09 1:43
khosnur30-Sep-09 1:43 
GeneralRe: file can be write on XP but can not on VISTA Pin
DaveyM6930-Sep-09 1:28
professionalDaveyM6930-Sep-09 1:28 
GeneralRe: file can be write on XP but can not on VISTA Pin
khosnur30-Sep-09 1:45
khosnur30-Sep-09 1:45 
AnswerRe: file can be write on XP but can not on VISTA Pin
Keith Barrow30-Sep-09 1:09
professionalKeith Barrow30-Sep-09 1:09 
GeneralRe: file can be write on XP but can not on VISTA Pin
khosnur30-Sep-09 1:13
khosnur30-Sep-09 1:13 

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.