|
What are you sending exactly ? Are the packets always constant size ? If no, how are you reading the data (show the code when you call recv funtion).
The socket will never append data: it just send what you asked it to send. So either:
- you send too much data
- or you try to read data after the data you received (so you read in memory after the received data, which is uninitialize memory, which explains those garbage characters).
|
|
|
|
|
Actually my client in VB, there we declared a string variable and we are appending data into that and after that we are sending data to the server which is in simple C language, where we declare a 512 byte buffer to collect the data.Data is of variable size vary between 76 to 83 byte.
Actually code is already written we just modifying it, perviously we are using this program on same host, but now our customer want to use this program on different host, so actually becoz buffer was very large so data is accumulating in the buffer before reading so we got some accumulated data and some corrupt data also.
Now what we did we just filling rest of the space of buffer by'*'(on client side) and taking the correct data on server side upto 1st '*' is encounter.
But in this approach we are facing one more problem we faced that some times data is correct some time some bytes of data is coming between '*'
like
correct data:
115237887261448874974239*****************************************************
uncorrect data:
********************************78798****************************************
i am not able to understand why these byte coming in between '*'.
Sorry sir our code is simple on like any other simple program, but i cant share u may code.
thanks
Lalit Aggarwal
|
|
|
|
|
Why don't you simply prepend the size of the data at the begining of the packet and only send what you need to send (without all those unnecessary * characters) ? On the receiver side, read first the size of the data and then read the appropriate number of bytes.
|
|
|
|
|
Hi,
I need to place a color combo box in one of the property pages and i downloaded color combobox Activex control. It is running successfully but the problem is whenever i run my program and click that property page it is showing an about box saying that it is an unregistered version and to register it in that website. Is there any way to avoid that about box may be from my program.
plz help...
|
|
|
|
|
Hi all,
I am extracting a MAPI property that has a different language characters, when I extract them I get ???.doc how can I convert this to the right character?
Thanks,
Jj
|
|
|
|
|
Do you have support for all needed languages?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Again extract and save that file and change encoding (ANSI) to encoding (unicode).
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Hi All!
I want to use some off the shelf ActiveX components in my project for visual display of information e.g. analog dials, thermometers, digital displays and graphs. I am using VC++ .NET 2005. Any body guide me in finding such ActiveX contols which are flexable but not too expensive, thanks.
<cool head="" makes="" lips="" smile="" more="">
|
|
|
|
|
There are some nice free controls on this website. Just search through the articles. But these are not ActiveX controls but just plain standard controls.
I developped also a charting control, check my sig if you are interested.
|
|
|
|
|
I have a CTreeCtrl in side a CDialog base class.
The hot keys are not functioning when the focus is on is on the Tree.
How to enable the hotkey function for CTreeCtrl??
Any suggestions??
Priya Sundar
|
|
|
|
|
Hi All,
I have created one simple application which inherits the CScrollBar Class of MFC.
problem is that when i run my application and click on ScrollBar nothing is happening.
no events are generated and sent to my class.
Can anyone tell me what could be the problem ? , did i miss anything ?
|
|
|
|
|
Your program didnt get any events or you forgot to declare these events on your program?
|
|
|
|
|
|
Hi,
I am using Visual Studio 2003 and trying to attach to a program that I have written in C++.
I am attempting to attach the debugger remotely (using tcp/ip) to a program which has asserted.
If I attach to the program before it asserts, there is not a problem and when the code asserts I get the usual break, continue options in a msg box. However what I need to do (don't ask why!) is attach to the program after it has asserted. If I do this however, The msg box appears on the remote system (the only option is "ok") and I don't get one on my PC. Therefore I don't get the option to break and cannot get to the piece of code that the assert occured in.
Anyone got any ideas if what I'm trying to do is possible. I know it sounds a bit weird, but I really need to be able to do this after the assert has occured.
Thanks in advance!
|
|
|
|
|
I find it a bit complicated. The debugger comes when the assertion is triggered. If you try to attach a debugger after, i don't see how can it be usefull at all.
Can you access the code there, where the assertion occurs?
Other thing would be copy there the dlls that are used to debug, then the messagebox should come with the retry and so on (but it is just a guess).
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I'm posting about this for second time, since no one replayed on my previous message!
I'm offering my users to chose hot key, I placed CHotKeyCtrl box on my dialog so they can do so. But when they press Win key nothing happens! If they would press for instance ctrl key or shift key CHotKeyCtrl box accepts it!
Why is this, or how can I make it accepts Win key also?
Thanks!
-- modified at 7:13 Thursday 18th October, 2007
|
|
|
|
|
|
Thanks for replay, I've solved my problem another way!
I viewed that article, but CHotKeyCtrl box on it's dialog also couldn't get Win key!
|
|
|
|
|
I gald it solved.
|
|
|
|
|
I have a VC++ program which used to print some document...my program gives same printing quality for all printers except EPSON- ink jet printer.....is there any printer specific routine i need to write which will support for epson fonts .my understanding is fonts and their charecteristics are printer independent! still why i suppose to get hazy fonts in epson...the printer is good working with other word documents....
thanx in advance...
birajendu
CyberG India
Delhi
India
|
|
|
|
|
I saw an article I think(not sure) it was on the codeproject about set some setting for printers but I forgot its name if you search on the codeproject you can find it.
|
|
|
|
|
Mmm, I was thinking it at the beggining too. But after programming the printing part of my project... I don't believe it anymore.
I got sucess declaring the things like that:
pDC->SetMapMode (MM_LOMETRIC);
CDC dcGraphMem; dcGraphMem.CreateCompatibleDC (pDC);
CFont fontLabels; fontLabels.CreatePointFont (80, "MS Sans Serif", pDC);
CFont fontInfo; fontInfo.CreatePointFont (140, "MS Sans Serif", pDC);
double dLeftOffset = 200 - (pDC->GetDeviceCaps (PHYSICALOFFSETX) * 254.0) / pDC->GetDeviceCaps (LOGPIXELSX);
double dTopOffset = 200 - (pDC->GetDeviceCaps (PHYSICALOFFSETY) * 254.0) / pDC->GetDeviceCaps (LOGPIXELSY);
double dRightMargin = 2770 - (pDC->GetDeviceCaps (PHYSICALOFFSETX) * 254.0) / pDC->GetDeviceCaps (LOGPIXELSX);
double dBottomMargin = 1950 -(pDC->GetDeviceCaps (PHYSICALOFFSETY) * 254.0) / pDC->GetDeviceCaps (LOGPIXELSY);
pInfo->m_rectDraw.left += (int) dLeftOffset;
pInfo->m_rectDraw.top += (int) dTopOffset;
pInfo->m_rectDraw.right = (int) dRightMargin;
pInfo->m_rectDraw.bottom = (int) dBottomMargin;
And then using it like that:
pDC->SelectObject (&fontLabels);
pDC->SetBkMode (TRANSPARENT);
pDC->TextOut (pInfo->m_rectDraw.left, 50 - pInfo->m_rectDraw.bottom, pDoc->GetFileName());
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello and good day. I currently have a problem with LoadImage (i think) in my application.
The application reads a file, changes it into bitmap format, uses LoadImage to display a file,
then uses StretchBlt to resize/rotate it. The user selects the file to load and display. Now the
problem is, I tried to do a stress test for it and the LoadImage fails after around 100 tries of
loading a 2000x2000 bmp file. I checked the HBITMAP handler which receives the data from the LoadImage and it contains NULL at that time. I still am not sure if the LoadImage is really the problem, I think it may be all the memory allocations I made but I checked them again and again and they were certainly released when a new image is loaded. Can somebody please advise me and help me about this problem?
Thank you!
|
|
|
|
|
|
The code is actually too large to paste in here. I can only paste the function which displays has the LoadImage part.
<br />
void CDlg::DisplayImage()<br />
{<br />
gOtherClass.gDisplayPanelHandle = (HBITMAP)::LoadImage<br />
( <br />
0, <br />
gMapPath, <br />
IMAGE_BITMAP, <br />
gSourceSize.cx,<br />
gSourceSize.cy,<br />
LR_DEFAULTCOLOR | LR_LOADFROMFILE <br />
);<br />
<br />
if(gOtherClass.gDisplayPanelHandle == NULL)<br />
{<br />
AfxMessageBox("Error!\nUnable to load Map File");<br />
return;<br />
}<br />
<br />
gCDC.SelectObject(gOtherClass.gDisplayPanelHandle);<br />
<br />
gCDC.StretchBlt<br />
(<br />
0, <br />
0,<br />
gSourceSize.cx,<br />
gSourceSize.cy,<br />
&gCDC,<br />
0, <br />
gSourceSize.cy - 1,
gSourceSize.cx,<br />
-gSourceSize.cy,<br />
SRCCOPY<br />
);<br />
Invalidate(FALSE);<br />
}<br />
|
|
|
|