Click here to Skip to main content
15,892,059 members
Home / Discussions / C#
   

C#

 
Questionsteganalysis algorithm Pin
nailahazem14-May-06 8:21
nailahazem14-May-06 8:21 
AnswerRe: steganalysis algorithm Pin
Colin Angus Mackay14-May-06 12:12
Colin Angus Mackay14-May-06 12:12 
Questionproblem with threading Pin
teejayem14-May-06 7:40
teejayem14-May-06 7:40 
AnswerRe: problem with threading Pin
mikker_12314-May-06 9:43
mikker_12314-May-06 9:43 
Generaltext to speech Pin
Christopher Duncan14-May-06 7:15
Christopher Duncan14-May-06 7:15 
GeneralRe: text to speech Pin
mikker_12314-May-06 9:36
mikker_12314-May-06 9:36 
GeneralRe: text to speech Pin
Christopher Duncan15-May-06 3:24
Christopher Duncan15-May-06 3:24 
QuestionWin32 API - Problems with SENDMESSAGE Pin
Seraphin14-May-06 7:12
Seraphin14-May-06 7:12 
Hello,

I have a problem with this code. Signature error, but why?

using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Runtime.InteropServices;<br />
using System.Windows.Forms;<br />
<br />
namespace EnumerateSingle<br />
{<br />
    public struct EditStream<br />
    {<br />
        public long dwCookie;<br />
        public long dwError;<br />
        public Delegate pfnCallback;<br />
    }<br />
    <br />
    class RichEditC<br />
    {<br />
        public const long WM_USER = 0x400; <br />
        public const long EM_STREAMIN = (WM_USER + 73); <br />
        public const long EM_STREAMOUT  = (WM_USER + 74);<br />
        public const long SF_TEXT = 0x1 ;<br />
        public const long SF_RTF = 0x2;<br />
        public const long SF_RTFNOOBJS  = 0x3; <br />
        public const long SF_TEXTIZED = 0x4;<br />
        public const long SF_UNICODE = 0x10; <br />
        public const long SF_USECODEPAGE  = 0x20;<br />
        public const long SF_NCRFORNONASCII = 0x40;<br />
<br />
        public delegate long RTFCallback(long dwCookie, long pbBuff, long cb, long pcb);<br />
<br />
        public string buffText;<br />
<br />
        [DllImport("User32.dll")]<br />
        public static extern long SendMessage(long hWnd, long wMsg, long wParam, ref EditStream lParam);<br />
                <br />
        [DllImport("User32.dll")]<br />
        public static extern void CopyMemory(object Destination, object source, long length);<br />
<br />
        public static long EditStreamCallback(long dwCookie, long pbBuff, long cb, long pcb)<br />
        {<br />
            StringBuilder buff = new StringBuilder((int)cb);<br />
            <br />
<br />
            switch(dwCookie)<br />
            {<br />
            case 999:<br />
                {<br />
                    CopyMemory(buff, pbBuff, cb);<br />
                    pcb = cb;<br />
                    return 0;<br />
                   <br />
                }<br />
            default:<br />
                {<br />
                    return -1;<br />
                    <br />
                }<br />
<br />
            }<br />
        }<br />
    }<br />
}


And the Clientcode:

        private void button3_Click(object sender, EventArgs e)<br />
        {<br />
            RichEditC.RTFCallback myRtfCallback = new RichEditC.RTFCallback(RichEditC.EditStreamCallback);<br />
            <br />
            EditStream es = new EditStream();<br />
            es.dwCookie = 999;<br />
            es.pfnCallback = myRtfCallback;<br />
<br />
            //Error------------------------------------------------------------------------><br />
            RichEditC.SendMessage(0x80524, RichEditC.EM_STREAMOUT, RichEditC.SF_TEXT, ref es);<br />
<br />
        }<br />
<br />
        public long FARPROC(long pfn)<br />
        {<br />
            return pfn;<br />
        }



Is "ref es" written in the wrong way? MSDN says that LPARAM for this SENDMESSAGE Action is a Structure, but I've defined it correctly.

Maybe anybody can help me with this problem. Thanks in advance.
AnswerRe: Win32 API - Problems with SENDMESSAGE Pin
Rei Miyasaka14-May-06 11:09
Rei Miyasaka14-May-06 11:09 
QuestionTrouble in byte\string coding Pin
NaNg1524114-May-06 6:00
NaNg1524114-May-06 6:00 
AnswerRe: Trouble in byte\string coding Pin
Guffa14-May-06 6:11
Guffa14-May-06 6:11 
GeneralRe: Trouble in byte\string coding Pin
NaNg1524114-May-06 6:31
NaNg1524114-May-06 6:31 
GeneralRe: Trouble in byte\string coding Pin
NaNg1524114-May-06 6:42
NaNg1524114-May-06 6:42 
QuestionRe: Trouble in byte\string coding Pin
NaNg1524114-May-06 6:50
NaNg1524114-May-06 6:50 
AnswerRe: Trouble in byte\string coding Pin
Guffa14-May-06 7:08
Guffa14-May-06 7:08 
GeneralRe: Trouble in byte\string coding Pin
NaNg1524114-May-06 7:12
NaNg1524114-May-06 7:12 
AnswerRe: Trouble in byte\string coding Pin
Guffa14-May-06 22:17
Guffa14-May-06 22:17 
QuestionRichTextBox questions? Pin
Cristoff14-May-06 5:27
Cristoff14-May-06 5:27 
AnswerRe: RichTextBox questions? Pin
Ed.Poore14-May-06 6:17
Ed.Poore14-May-06 6:17 
GeneralRe: RichTextBox questions? Pin
Cristoff14-May-06 9:20
Cristoff14-May-06 9:20 
GeneralRe: RichTextBox questions? Pin
Ed.Poore14-May-06 9:45
Ed.Poore14-May-06 9:45 
GeneralRe: RichTextBox questions? Pin
Cristoff14-May-06 10:12
Cristoff14-May-06 10:12 
QuestionArraySort Pin
zhujp9814-May-06 5:08
zhujp9814-May-06 5:08 
AnswerRe: ArraySort Pin
Josh Smith14-May-06 5:19
Josh Smith14-May-06 5:19 
AnswerRe: ArraySort Pin
Rei Miyasaka14-May-06 10:42
Rei Miyasaka14-May-06 10:42 

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.