|
What errors? What does not working mean?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
HI
In Server socket OnAccept
if(Accept(Serversock)==1)
AfxmessageBox("Server Accepted");
else
AfxmessageBox("Server not Accepted");
On this code it does not showing "Server not Accepted" or "Server not Accepted"
But it was run cleraly in vc6.0.
shakumar
|
|
|
|
|
Wow. That has absolutely nothing related to your first post
All I can tell so far is that you have some debugging to do.
Your VC6 code compiles and links with no errors or warnings, right?
You mentioned recieving thread messages - the prototype for the ON_THREAD_MESSAGE handler function
changed. The return type is now void.
MArk
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
Thanks for your Reply
As your suggestion ,
Returning type was changed to "Void" ok ther no error now.
But there was an Runtime error in OnAccept();
My programe was Socket programme,
Server Socket Created, Listening;
Client Socket Created, Connected to Server.
When Client Connect to Server Socket in Server Socket OnAccept() Function its get Run time Error.
CServer::OnAccept()
{
if(Accept(Serversock)==1)
AfxmessageBox("Server Accepted");
else
AfxmessageBox("Server not Accepted");
}
Awaiting for your reply
shakumar
|
|
|
|
|
shakumar_22 wrote: When Client Connect to Server Socket in Server Socket OnAccept() Function its get Run time Error.
What error? If you run in the debugger and put a breakpoint at the start of CServer::OnAccept(),
does the breakpoint get hit? If so, and you single step through the code, where does the error
occur?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Wow. That has absolutely nothing related to your first post
The first post was some pain yeld by the CAPS LOCK key being hit.
|
|
|
|
|
|
Hi all,
I am trying to draw a gradient rectangle using the below code. But the problem is am not getting the correct color in the bottom. As per the code the expected color is RGB(0,0,255). But now I am getting RGB(3,0,252). Is there any way to show the correct value?
Color clr1( 255,255,0,0 );<br />
Color clr2( 255,0,0,255 );<br />
Rect rect( 0,0,100,100 );<br />
LinearGradientBrush pushedFace( rect, clr1, clr2, LinearGradientModeVertical );<br />
CClientDC dc(this);<br />
Graphics gr(dc.m_hDC);<br />
gr.FillRectangle( &pushedFace,rect );
Thanks in advance
|
|
|
|
|
Naveen.R wrote: Is there any way to show the correct value?
Add 1 to the rect height.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
you mean like
LinearGradientBrush pushedFace( Rect( 0,0, 30, 101 ), clr1, clr2, LinearGradientModeVertical ); .
In this case the color became more lighter. RGB(5,0,250)
|
|
|
|
|
You're right! LOL sorry.
The problem is with the math (apparently which I'm too tired to comprehend ).
Incrementing evenly through 100 rows from 0 to 255, the last row ends at 252.45 or 252.
There's no way around it that I know of except adjusting the width/height to a value that makes
it come out exact.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Incrementing evenly through 100 rows from 0 to 255
Well I tried making the following changes. Set the height as 255.clr1 = RGB( 0,0,0), clr2 = RGB(0,0,255 )
In this case the color should come correct isnt it? but now the color is 0,0,254 at the bottom( I know the color change is not noticeable. But I have to meet the specifications... ).
|
|
|
|
|
|
Mark Salsbery wrote: You may have to come up with your own formula.
Thanks for your support.
|
|
|
|
|
I'll look deeper into this in the morning - for now, I have to sleep
Good luck!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I'll look deeper into this in the morning - for now, I have to sleep
Thanks for that... Good night.
|
|
|
|
|
OK, if you want to roll your own gradient rect, this formula should work
(((r2 - r1) / (rectheight - 1)) * currentrow) + r1 = rdest
(((g2 - g1) / (rectheight - 1)) * currentrow) + g1 = gdest
(((b2 - b1) / (rectheight - 1)) * currentrow) + b1 = bdest
where
r,g,b == red,green,blue components
Desired Start row color == RGB(r1,g1,b1)
Desired End row color == RGB(r2,g2,b2)
currentrow == current row of rect being drawn (0-based)
RGB(rdest,gdest,bdest) is the resulting color for the currentrow
Note this requires floating point so it will be slower than the standard integer formula.
The example is for vertical gradient - it would work for columns as well (horizontal gradient).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
How to get the Dialog handle of Dialog-based application?
Best Regards,
Suman
|
|
|
|
|
use GetSafeHwnd()
Manish Rastogi
|
|
|
|
|
Hi Manish,
Thanks for the help!!
Best Regards,
Suman
|
|
|
|
|
|
Hi, I want to find the format of a wav file. I use the MediaDetector interface like this:
CoCreateInstance(CLSID_MediaDet,NULL,CLSCTX_INPROC_SERVER,IID_IMediaDet,(void**) &pIMediaDet);
I have included dshow.h and linked to strmiids.lib but I get these link errors:
AudioController.obj : error LNK2001: unresolved external symbol _CLSID_MediaDet
AudioController.obj : error LNK2001: unresolved external symbol _IID_IMediaDet
Any help would be appreciated.
Thanks
Ratna
|
|
|
|
|
#include <Qedit.h>
"This header file is not compatible with Microsoft® Direct3D® headers later than version 7."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
I am a beginner in MFC. Here is my problem :
I have a MDI application, when I display one image on a child frame, the image disappear if I move(resize or minimize) the frame. I don't really know where the problem comes from.
In my Child frame, I use :
<br />
ON_COMMAND_RANGE(ID_IMAGE1, ID_IMAGE2, OnView)<br />
OnView is like :
<br />
void CChildFrame::OnView(UINT nID)<br />
{<br />
CBitmap bmp1, bmp2;<br />
CClientDC dc1(this), dc2(this);<br />
CDC bmDC1, bmDC2;<br />
BITMAP bi1, bi2;<br />
bmp1.LoadBitmap(IDB_BITMAP1);<br />
bmp2.LoadBitmap(IDB_BITMAP2);<br />
<br />
bmDC1.CreateCompatibleDC(&dc1);<br />
bmDC2.CreateCompatibleDC(&dc2);<br />
<br />
CBitmap *pOldbmp1 = bmDC1.SelectObject(&bmp1);<br />
CBitmap *pOldbmp2 = bmDC2.SelectObject(&bmp2);<br />
<br />
bmp1.GetBitmap(&bi1);<br />
bmp2.GetBitmap(&bi2);<br />
<br />
<br />
switch( nID )<br />
{<br />
case ID_IMAGE1:<br />
<br />
dc1.BitBlt(0,0,bi1.bmWidth,bi1.bmHeight,&bmDC1,0,0,SRCCOPY);<br />
bmDC1.SelectObject(pOldbmp1); <br />
<br />
break;<br />
<br />
case ID_IMAGE2:<br />
<br />
dc2.BitBlt(0,0,bi2.bmWidth,bi2.bmHeight,&bmDC2,0,0,SRCCOPY);<br />
bmDC2.SelectObject(pOldbmp2);<br />
<br />
break;<br />
}<br />
}<br />
Any help would be very appreciated
|
|
|
|
|