Click here to Skip to main content
15,891,633 members
Home / Discussions / C#
   

C#

 
GeneralRe: no parameterless constructor defined for this object Pin
OriginalGriff16-Jul-16 1:48
mveOriginalGriff16-Jul-16 1:48 
GeneralRe: no parameterless constructor defined for this object Pin
Gilbert Consellado16-Jul-16 4:00
professionalGilbert Consellado16-Jul-16 4:00 
GeneralRe: no parameterless constructor defined for this object Pin
OriginalGriff16-Jul-16 4:05
mveOriginalGriff16-Jul-16 4:05 
GeneralRe: no parameterless constructor defined for this object Pin
Gilbert Consellado16-Jul-16 4:30
professionalGilbert Consellado16-Jul-16 4:30 
GeneralRe: no parameterless constructor defined for this object Pin
OriginalGriff16-Jul-16 4:35
mveOriginalGriff16-Jul-16 4:35 
AnswerRe: no parameterless constructor defined for this object Pin
Imagiv16-Jul-16 4:13
Imagiv16-Jul-16 4:13 
GeneralRe: no parameterless constructor defined for this object Pin
Gilbert Consellado16-Jul-16 4:43
professionalGilbert Consellado16-Jul-16 4:43 
QuestionHow to load form's content (Controls in form) from XML file Pin
HoaiTamAnh15-Jul-16 15:50
HoaiTamAnh15-Jul-16 15:50 
AnswerRe: How to load form's content (Controls in form) from XML file Pin
Richard MacCutchan15-Jul-16 21:48
mveRichard MacCutchan15-Jul-16 21:48 
AnswerRe: How to load form's content (Controls in form) from XML file Pin
BillWoodruff16-Jul-16 2:34
professionalBillWoodruff16-Jul-16 2:34 
QuestionManually linking in references Pin
TheOnlyRealTodd14-Jul-16 23:33
professionalTheOnlyRealTodd14-Jul-16 23:33 
AnswerRe: Manually linking in references Pin
OriginalGriff14-Jul-16 23:45
mveOriginalGriff14-Jul-16 23:45 
AnswerRe: Manually linking in references Pin
Eddy Vluggen14-Jul-16 23:58
professionalEddy Vluggen14-Jul-16 23:58 
SuggestionRe: Manually linking in references Pin
maverick199115-Jul-16 22:30
professionalmaverick199115-Jul-16 22:30 
QuestionPassing Memory Stream between C# Windows Pin
sunsher14-Jul-16 18:02
sunsher14-Jul-16 18:02 
AnswerRe: Passing Memory Stream between C# Windows Pin
Mycroft Holmes14-Jul-16 20:11
professionalMycroft Holmes14-Jul-16 20:11 
AnswerRe: Passing Memory Stream between C# Windows Pin
Pete O'Hanlon14-Jul-16 20:46
mvePete O'Hanlon14-Jul-16 20:46 
GeneralRe: Passing Memory Stream between C# Windows Pin
sunsher17-Jul-16 13:04
sunsher17-Jul-16 13:04 
GeneralRe: Passing Memory Stream between C# Windows Pin
Pete O'Hanlon17-Jul-16 21:12
mvePete O'Hanlon17-Jul-16 21:12 
GeneralRe: Passing Memory Stream between C# Windows Pin
sunsher18-Jul-16 13:01
sunsher18-Jul-16 13:01 
GeneralRe: Passing Memory Stream between C# Windows Pin
sunsher18-Jul-16 13:55
sunsher18-Jul-16 13:55 
This did work!

C#
MemoryStream ms = new MemoryStream();
            using (ms = GetMemoryStream())
            {
                ms = new MemoryStream(ms.ToArray());

                COPYDATASTRUCT cds;
                cds.dwData = 0;
                cds.lpData = IntPtr.Zero;
                cds.cbData = 0;

                try
                {
                    ms.Flush();
                    ms.Position = 0;
                    
                    int hWnd = FindWindow(null, "Receive");
                    int dataSize = Convert.ToInt32(ms.Length);

                    cds.dwData = 0;
                    cds.lpData = Marshal.AllocCoTaskMem(dataSize);
                    cds.cbData = dataSize;

                    SendMessage(hWnd, WM_COPYDATA, 0, ref cds);
                }
                finally
                {
                    Marshal.FreeCoTaskMem(cds.lpData);
                    ms.Close();
                }
            }


But I think I'm not passing the memory stream to the other application. I declared the dwData as Memory Stream. Am I doing right?
GeneralRe: Passing Memory Stream between C# Windows Pin
sunsher18-Jul-16 15:17
sunsher18-Jul-16 15:17 
QuestionLifo and Fifo Pin
Member 1116162514-Jul-16 17:53
Member 1116162514-Jul-16 17:53 
AnswerRe: Lifo and Fifo Pin
Mycroft Holmes14-Jul-16 20:13
professionalMycroft Holmes14-Jul-16 20:13 
AnswerRe: Lifo and Fifo Pin
Richard MacCutchan14-Jul-16 21:42
mveRichard MacCutchan14-Jul-16 21: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.