Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
QuestionC# navigating to top of page Pin
nyjcr14-Jun-08 5:43
nyjcr14-Jun-08 5:43 
AnswerRe: C# navigating to top of page Pin
N a v a n e e t h14-Jun-08 5:55
N a v a n e e t h14-Jun-08 5:55 
Questionhow to can i run or execute another program from C# ... like winword for example ?? Pin
Zero coder14-Jun-08 3:44
Zero coder14-Jun-08 3:44 
AnswerRe: how to can i run or execute another program from C# ... like winword for example ?? Pin
Christian Graus14-Jun-08 3:47
protectorChristian Graus14-Jun-08 3:47 
AnswerRe: how to can i run or execute another program from C# ... like winword for example ?? [modified] Pin
erfi15-Jun-08 4:20
erfi15-Jun-08 4:20 
QuestionProblem for CCD Image Display in my Application Pin
PowerOn14-Jun-08 2:41
PowerOn14-Jun-08 2:41 
AnswerRe: Problem for CCD Image Display in my Application Pin
Christian Graus14-Jun-08 3:47
protectorChristian Graus14-Jun-08 3:47 
QuestionHelp: ReadPrint(winspool) & C# Pin
_CMD_14-Jun-08 2:26
_CMD_14-Jun-08 2:26 
I use WritePrinter - work, but ReadPrinter return empty

[DllImport("winspool.drv", CharSet = CharSet.Ansi, ExactSpelling = true,CallingConvention = CallingConvention.StdCall)]
public static extern long ReadPrinter(IntPtr hPrinter, StringBuilder data, int buf, out int pcRead);

 public static int ReadFromPrinter(string szPrinterName, string szString)
        {
            Int32 dwError = 0, dwWritten = 0;
            IntPtr hPrinter = new IntPtr(0);
            StringBuilder sb = new StringBuilder();
            DOCINFOA di = new DOCINFOA();
            bool bSuccess = false; // Assume failure unless you specifically succeed.

            di.pDocName = "My C#.NET RAW Document";
            di.pDataType = "RAW";

            // Open the printer.
            if (OpenPrinter(szPrinterName.Normalize(), out hPrinter, IntPtr.Zero))
            {
                // Start a document.
                if (StartDocPrinter(hPrinter, 1, di))
                {
                    // Start a page.
                    if (StartPagePrinter(hPrinter))
                    {
                        // Write your bytes.
                        IntPtr pBytes;
                        Int32 dwCount;
                        // How many characters are in the string?
                        System.Text.Encoding ascii = System.Text.Encoding.GetEncoding(866);
                        byte[] myStringInASCII = ascii.GetBytes(szString);
                        szString = ascii.GetString(myStringInASCII);
                        dwCount = szString.Length;
                        // Assume that the printer is expecting ANSI text, and then convert
                        // the string to ANSI text.
                        pBytes = Marshal.StringToCoTaskMemAnsi(szString);
                        // Send the converted ANSI string to the printer.                        
                        bSuccess = WritePrinter(hPrinter, pBytes, dwCount, out dwWritten);
                        Marshal.FreeCoTaskMem(pBytes);                        
                        
                        EndPagePrinter(hPrinter);
                    }
                    EndDocPrinter(hPrinter);
                }
///   Problem    ////////////////////////
                long out1 = ReadPrinter(hPrinter, sb, 6, out dwWritten);
///   Here variable sb return empty   ///////////////////////
                ClosePrinter(hPrinter);
            }
            // If you did not succeed, GetLastError may give more information
            // about why not.
            if (bSuccess == false)
            {
                dwError = Marshal.GetLastWin32Error();
            }
            return 1;
        }



Where error?
thanks


QuestionInvoking SSIS PAckage from C# Pin
Member 400849213-Jun-08 22:40
Member 400849213-Jun-08 22:40 
QuestionNear-static class [modified] Pin
PIEBALDconsult13-Jun-08 13:25
mvePIEBALDconsult13-Jun-08 13:25 
AnswerRe: Near-static class Pin
MarkB77713-Jun-08 14:29
MarkB77713-Jun-08 14:29 
GeneralRe: Near-static class Pin
PIEBALDconsult13-Jun-08 15:28
mvePIEBALDconsult13-Jun-08 15:28 
GeneralRe: Near-static class Pin
MarkB77713-Jun-08 16:01
MarkB77713-Jun-08 16:01 
GeneralRe: Near-static class Pin
leppie13-Jun-08 21:56
leppie13-Jun-08 21:56 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 10:01
mvePIEBALDconsult16-Jun-08 10:01 
AnswerRe: Near-static class Pin
Ed.Poore13-Jun-08 20:50
Ed.Poore13-Jun-08 20:50 
GeneralRe: Near-static class Pin
PIEBALDconsult14-Jun-08 5:12
mvePIEBALDconsult14-Jun-08 5:12 
GeneralRe: Near-static class Pin
Ed.Poore14-Jun-08 8:12
Ed.Poore14-Jun-08 8:12 
GeneralRe: Near-static class Pin
PIEBALDconsult14-Jun-08 18:45
mvePIEBALDconsult14-Jun-08 18:45 
GeneralRe: Near-static class Pin
Ed.Poore14-Jun-08 21:18
Ed.Poore14-Jun-08 21:18 
GeneralRe: Near-static class Pin
PIEBALDconsult15-Jun-08 7:45
mvePIEBALDconsult15-Jun-08 7:45 
GeneralRe: Near-static class Pin
Ed.Poore15-Jun-08 9:08
Ed.Poore15-Jun-08 9:08 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 11:05
mvePIEBALDconsult16-Jun-08 11:05 
GeneralRe: Near-static class Pin
Ed.Poore16-Jun-08 11:15
Ed.Poore16-Jun-08 11:15 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 12:41
mvePIEBALDconsult16-Jun-08 12:41 

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.