Click here to Skip to main content
11,581,982 members (79,130 online)

C / C++ / MFC

 
Questionunable to register COM dll 64 bit Pin
john563231-Jan-13 2:12
memberjohn563231-Jan-13 2:12 
AnswerRe: unable to register COM dll 64 bit Pin
«_Superman_»1-Feb-13 16:59
member«_Superman_»1-Feb-13 16:59 
QuestionPlay Media File Pin
john563230-Jan-13 19:38
memberjohn563230-Jan-13 19:38 
AnswerRe: Play Media File Pin
Flaviu230-Jan-13 21:47
memberFlaviu230-Jan-13 21:47 
GeneralRe: Play Media File Pin
john563231-Jan-13 1:07
memberjohn563231-Jan-13 1:07 
AnswerRe: Play Media File Pin
jeron131-Jan-13 4:28
memberjeron131-Jan-13 4:28 
GeneralRe: Play Media File Pin
john563231-Jan-13 17:09
memberjohn563231-Jan-13 17:09 
GeneralRe: Play Media File Pin
jeron11-Feb-13 7:27
memberjeron11-Feb-13 7:27 
GeneralRe: Play Media File Pin
merano1-Feb-13 14:11
membermerano1-Feb-13 14:11 
QuestionTCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 1:29
membertoms from newdelhi30-Jan-13 1:29 
AnswerRe: TCP Server: Render the image on server side Pin
Richard MacCutchan30-Jan-13 3:01
mvpRichard MacCutchan30-Jan-13 3:01 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 16:44
membertoms from newdelhi30-Jan-13 16:44 
GeneralRe: TCP Server: Render the image on server side Pin
Richard MacCutchan30-Jan-13 21:52
mvpRichard MacCutchan30-Jan-13 21:52 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 22:53
membertoms from newdelhi30-Jan-13 22:53 
I did tried with this one...
 
case WM_SOCKET:
		{
			int i=256;
			BYTE* data = new BYTE[256*256*256];
  int packetsize, num;
  int newWidth, newHeight;
  int recvimgsize=0;
 
   bool bAwaitingImage = false;
			switch(WSAGETSELECTEVENT(lParam))
			{
				case FD_READ:
				{
	
					  num=recv(Socket, (char*)data, 3, 0);
				
				if(num>0)
      {
 
		 
        packetsize = data[1]*256+ data[2];
 
        num=recv(Socket, (char*)(data+3), packetsize-3, 0);
     
				}
				 if(num>0)
				 {
				 switch(data[0])
				 {
				  case 2: //received information about window size (image size)

					 
            newWidth = data[3]*256+data[4];
            newHeight = data[5]*256+data[6];
					   		 
				 
			if(newHeight!=cBitmap.bmHeight || newWidth!=cBitmap.bmWidth)
            {
				cBitmap.bmWidth = newWidth;
				cBitmap.bmHeight = newHeight;
 
              RECT r;
 
			   GetWindowRect(hWnd, &r);
			   SetWindowPos(hWnd, NULL, r.left, r.top, cBitmap.bmWidth, cBitmap.bmHeight, 0);
 

			   HDC ThisDC = GetDC(hWnd);
 
              DeleteDC(RemoteDC);
              RemoteDC = CreateCompatibleDC(ThisDC);
 
              DeleteObject(hbitmap);
			  hbitmap = CreateCompatibleBitmap(ThisDC,cBitmap.bmWidth ,cBitmap.bmHeight);
 
              SelectObject(RemoteDC, hbitmap);
 
              ReleaseDC(hWnd, ThisDC);
 
				 }
				 break;
				 
 
				  case 3:
          {
            BITMAPINFO bi;
           
            int biSize = sizeof(BITMAPINFO);
            memcpy(&bi, data+3, biSize);
			SetDIBits(RemoteDC, hbitmap, 0,cBitmap.bmHeight, data+biSize+3, &bi, DIB_RGB_COLORS);
 
            InvalidateRect(hWnd, NULL, false);
 
            break;
          }
 


its a long code ,,,
but i got stuck on when client sends image then it is completely sent but from server side program hangs and stopped working and nothing on server.

I'll be highly thankful if you can help me in this!!
Thanks
GeneralRe: TCP Server: Render the image on server side Pin
Richard MacCutchan30-Jan-13 22:56
mvpRichard MacCutchan30-Jan-13 22:56 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 22:59
membertoms from newdelhi30-Jan-13 22:59 
GeneralRe: TCP Server: Render the image on server side Pin
Richard MacCutchan30-Jan-13 23:08
mvpRichard MacCutchan30-Jan-13 23:08 
AnswerRe: TCP Server: Render the image on server side Pin
Erudite_Eric30-Jan-13 3:13
memberErudite_Eric30-Jan-13 3:13 
GeneralRe: TCP Server: Render the image on server side Pin
Richard MacCutchan30-Jan-13 4:35
mvpRichard MacCutchan30-Jan-13 4:35 
GeneralRe: TCP Server: Render the image on server side Pin
Erudite_Eric30-Jan-13 5:01
memberErudite_Eric30-Jan-13 5:01 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 16:47
membertoms from newdelhi30-Jan-13 16:47 
GeneralRe: TCP Server: Render the image on server side Pin
Erudite_Eric30-Jan-13 22:36
memberErudite_Eric30-Jan-13 22:36 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 22:57
membertoms from newdelhi30-Jan-13 22:57 
GeneralRe: TCP Server: Render the image on server side Pin
Erudite_Eric31-Jan-13 21:35
memberErudite_Eric31-Jan-13 21:35 
AnswerRe: TCP Server: Render the image on server side Pin
Andy Bantly30-Jan-13 12:12
memberAndy Bantly30-Jan-13 12:12 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 16:51
membertoms from newdelhi30-Jan-13 16:51 
GeneralRe: TCP Server: Render the image on server side Pin
Andy Bantly3-Feb-13 3:58
memberAndy Bantly3-Feb-13 3:58 
QuestionCan a modeless dialog box be a main window Pin
ForNow29-Jan-13 11:44
memberForNow29-Jan-13 11:44 
AnswerRe: Can a modeless dialog box be a main window Pin
«_Superman_»29-Jan-13 19:17
member«_Superman_»29-Jan-13 19:17 
GeneralRe: Can a modeless dialog box be a main window Pin
ForNow29-Jan-13 19:34
memberForNow29-Jan-13 19:34 
AnswerRe: Can a modeless dialog box be a main window Pin
Richard MacCutchan29-Jan-13 21:10
mvpRichard MacCutchan29-Jan-13 21:10 
GeneralRe: Can a modeless dialog box be a main window Pin
ForNow30-Jan-13 7:30
memberForNow30-Jan-13 7:30 
GeneralRe: Can a modeless dialog box be a main window Pin
Richard MacCutchan30-Jan-13 7:34
mvpRichard MacCutchan30-Jan-13 7:34 
GeneralRe: Can a modeless dialog box be a main window Pin
ForNow30-Jan-13 8:13
memberForNow30-Jan-13 8:13 
GeneralRe: Can a modeless dialog box be a main window Pin
Richard MacCutchan30-Jan-13 9:07
mvpRichard MacCutchan30-Jan-13 9:07 
AnswerRe: Can a modeless dialog box be a main window Pin
Erudite_Eric30-Jan-13 3:04
memberErudite_Eric30-Jan-13 3:04 
GeneralRe: Can a modeless dialog box be a main window Pin
ForNow30-Jan-13 7:31
memberForNow30-Jan-13 7:31 
QuestionAnyone heard of an Anonymous Statistics / User Experience API or Toolkit Pin
Blake Miller29-Jan-13 6:11
memberBlake Miller29-Jan-13 6:11 
QuestionHow to load a png image in PictureControl? Pin
VCProgrammer29-Jan-13 1:41
groupVCProgrammer29-Jan-13 1:41 
QuestionRe: How to load a png image in PictureControl? Pin
Richard MacCutchan29-Jan-13 3:33
mvpRichard MacCutchan29-Jan-13 3:33 
AnswerRe: How to load a png image in PictureControl? Pin
yu-jian29-Jan-13 15:40
groupyu-jian29-Jan-13 15:40 
GeneralRe: How to load a png image in PictureControl? Pin
VCProgrammer30-Jan-13 22:19
groupVCProgrammer30-Jan-13 22:19 
GeneralRe: How to load a png image in PictureControl? Pin
yu-jian1-Feb-13 4:04
groupyu-jian1-Feb-13 4:04 
GeneralRe: How to load a png image in PictureControl? Pin
VCProgrammer4-Feb-13 1:24
groupVCProgrammer4-Feb-13 1:24 
QuestionIn win7 ,how to modify registry with Non - administrator permission Pin
haha_c28-Jan-13 21:08
memberhaha_c28-Jan-13 21:08 
AnswerRe: In win7 ,how to modify registry with Non - administrator permission Pin
Jochen Arndt28-Jan-13 21:38
memberJochen Arndt28-Jan-13 21:38 
GeneralRe: In win7 ,how to modify registry with Non - administrator permission Pin
haha_c28-Jan-13 22:02
memberhaha_c28-Jan-13 22:02 
GeneralRe: In win7 ,how to modify registry with Non - administrator permission Pin
Jochen Arndt28-Jan-13 22:57
memberJochen Arndt28-Jan-13 22:57 
GeneralRe: In win7 ,how to modify registry with Non - administrator permission Pin
haha_c28-Jan-13 23:18
memberhaha_c28-Jan-13 23:18 
GeneralRe: In win7 ,how to modify registry with Non - administrator permission Pin
Jochen Arndt28-Jan-13 23:33
memberJochen Arndt28-Jan-13 23:33 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 7 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid