|
In UDP there is no need to give ACK. so it is not reliable.
That's why udp take less bandwith for realtime transmission.
& It's easy to send multicast data via udp.
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
The biggest difference is that TCP/IP provides guaranteed delivery of messages in a specific order. UDP does not; messages can be fail to be delivered, or delivered out of order.
Software Zen: delete this;
|
|
|
|
|
UDP is a connectionless protocol which means is doesn't maintain a connection between sender and receiver. I believe with UDP packet delivery isn't guaranteed and the packets are not even guaranteed to be received in the same order sent. It consumes fewer resources however. I'm not an expert in this field however. I'd recommend doing some reading.
Steve
|
|
|
|
|
|
While running project in debug mode , I am able to add breakpoints
but as soon as I start debugging with F5 it gives one note and disable
all the breakpoints in program. What can be reason ?
|| ART OF LIVING ||
|
|
|
|
|
shivditya wrote: F5 it gives one note and disable
all the breakpoints in program. What can be reason ?
what note it is giving? Generally this happen, when file having break point is not part of exe.
|
|
|
|
|
It seems you need to see property from your project for see debug status
|
|
|
|
|
I created a ATL project with the VS2005, and in the project I used the c# component. So I selected the "Common Language Runtime Support(/clr)",
First I built the Release version, and compiled successfully.
But when I built the Debug version, I encountered a problem, the compiled failed. and prompt "Command line error D8045 :cannot compile C file 'MCChannel_i.c' with the /clr option". I tried to disable the /clr option, but there is other compiler error.
Who know the reason, please help me , thanks!
|
|
|
|
|
I have been building static link libraries lately and when I come to use them I get the following linker error:
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
I know it is safe to ignore, but is there some code I should be adding somewhere so that I don't get the error in the first place?
|
|
|
|
|
not sure dude - I usually see this sort of thing when Im using a library compiled in say multithreaded mode with another library or the base project thats in single thread mode - I can spot these ones now and fix them (often requiring a rebuild of each sub-project or library/dll to the same 'mode') ...and in these cases, using /NODEFAULTLIB doesnt usually work
hopefully someone else will have a better comment than mine
'g'
|
|
|
|
|
I did the code to cut and store a portion of clip image as a separate clip file(avi). The new AVI file is written successfully, but couldnt open and play it.
The following message is shown when i try to play the new clip image obtained.
Windows Media Player cannot play the file. The file is either corrupt or the Player does not support the format you are trying to play.
Thanks in advance for those who help
-- modified at 0:54 Saturday 26th August, 2006
chandana
|
|
|
|
|
Im not sure but it seems your file needs to header in beginnig for example if you cut a mpeg file without video programs then you can see first file you cant see second file.
|
|
|
|
|
I know that this is kindof far fetched, but we'll see if anyone knows.
I was wondering if there was a way to click a button remotely. Basically, I want to be able to click a button through code. I don't want to simply run the effects, but actually click the button. I was thinking about the SendMessage() function, but I didn't know how to begin with that.
Thanks in advance for those who help.
|
|
|
|
|
Can you be more specific whats meaning of button remote.
|
|
|
|
|
Hi, I am a beginner to displaying images using mfc and c++ in general. Specifically, I want to display a bitmap from a buffer that I write camera data to. I have already got this to work after many hours of trial and error but I still don't understand exactly what I did or if there is a better way to do it. I am having a hard time finding a really good one stop resource. I was wondering if someone could recommend something? Thanks in advance.
Clint Smith
|
|
|
|
|
one solution would be to create a device-independent bitmap (DIB) section. This way you can directly write to the image buffer and then use StretchDIBits (if i remember correctly) to draw it to your window. its not trivial for a beginner, but i think thats the road you need to go down, unless someone else can suggest a simpler solution.
|
|
|
|
|
that's actually exactly what I have done and it did work. It really wasn't alot of code but it was really a lot of work for me to figure it out by looking at blogs and websites and the little I could find in a couple of visual c++ books I have. Well, thanks for the reply...I appreciate it!
Clint Smith
|
|
|
|
|
Assuming that GDI+ is not an option, 'Windows Graphics Programming' by Feng Yuan is an awesome book.
HP publishes it, I believe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thanks so much....I will check out that book...
Clint Smith
|
|
|
|
|
I'm actually trying to save in a .dib file an image that I create pixel by pixel (without displaying it in a view). I'm able to create the file and the header (but i'm certainly wrong ...?) with this code but the result is a blank file (but the properties of the file are fine, eg.: size, color depth). I have no idea how to draw pixels in the file:
BITMAPFILEHEADER hdr;
BITMAPINFOHEADER bi;
CFile file;
file.Open( szFile, CFile::modeWrite|CFile::modeCreate);
bi.biBitCount = 24;
bi.biClrImportant = 0;
bi.biClrUsed = 0;
bi.biCompression = BI_RGB;
bi.biHeight = 2048;
bi.biPlanes = 1;
bi.biSize = sizeof(BITMAPINFOHEADER);
bi.biSizeImage = 0;
bi.biWidth = 1024;
bi.biXPelsPerMeter = 0;
bi.biYPelsPerMeter = 0;
int nColors = 1 << bi.biBitCount;
hdr.bfType= ((WORD) ('M' << 8) | 'B');
hdr.bfSize= sizeof(bi) + sizeof( hdr );
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
hdr.bfOffBits= (DWORD) (sizeof( hdr ) + bi.biSize + nColors * sizeof(RGBQUAD));
file.Write( &hdr, sizeof(hdr) );
file.Write( &bi, sizeof(bi) );
file.Close();
I tried with mfc's DCs but I want to save an image much larger than the window. Also I don't wanna display it in a view. Does anyone has an idea how to achieve this, with or without DCs?
|
|
|
|
|
Some things I noticed with the code:
1) hdr.bfSize should be the size of the entire file not just the headers and color table
2) I don't think you need a color table if you're doing a 24-bit image; you should be able to remove it from your offset calculation
3) your code is only writing out the file header and the info header and nothing else, so you're not going to see anything; you need to write out the actual image data after the info structure
See the MSDN docs for device independent bitmaps for more info.
Also, if you want to use the GDI functions to do rendering, then you'll need to have a DIB section and select it into a DC. If you're just writing the pixels directly to the memory, then this isn't necessary.
|
|
|
|
|
thanks for your reply Dave.
I checked out the msdn stuff for DIBs. they write that a bitmap file should include: the file header, the info header, the RGBQUAD array and the color index array. now i create the RGBQUAD array:
RGBQUAD rgdquad[ ? ];
file.Write( &rgdquad, sizeof(rgdquad) );
but i have no idea how big this array should be. is it the number of pixel , the color depth, etc? And what do they mean by : "color index"? it is a BYTE, a char ... a COLORREF, array?
|
|
|
|
|
I believe you need to write out the following
file header
info header
palette
image data
the palette is a series of colors (RGB), but this is only used if you're using a palette. if you choose 8-bit color, then your image data will consist of indices into this palette.
in your example, however, you showed 24-bit color. this means you don't need a palette. instead your image data specifies the red-green-blue for each pixel. so for a 24-bit image, i think you'd write the following to the file:"
file header
info header
image data
when you write out the image data, you write each row of pixels. after each row, you may need to write padding bytes as I _think_ each row needs to be aligned on certain byte boundary (not 100% certain about this, but I remember somewhere having to do this). for each pixel, you'll write out 1 byte each for red green and blue (can't remember the order) value.
|
|
|
|
|
again, thank you Dave for your reply
ok I found how to write data into the file and I removed the palette. The result is a bitmap but the colors seems to be "random". I suppose it's because of the order of the bits and the byte boundary you were talking about
so whit a small 2x2 image, these value:
hp[0] = 0xFF;
hp[1] = 0x00;
hp[2] = 0x00;
hp[4] = 0xFF;
hp[5] = 0x00;
hp[6] = 0x00;
hp[9] = 0xFF;
hp[10] = 0x00;
hp[11] = 0x00;
hp[13] = 0xFF;
hp[14] = 0x00;
hp[15] = 0x00;
Gave me a
Magnenta - Orange
Blue - Magnenta
but it was supposed to be the same color everywhere. Do you have a clue on this?
|
|
|
|
|
If you're not seeing the same color throughout the image, then as you said its probably an alignment issue. I looked around and was unable to find the docs I used way back when when I was doing something similar.
Note that there might be an easier way to do this. The CImage class will save to the DIB (.bmp) file as well as a ton of other formats. So, if you can get your image into a CImage, you can then let it do the saving for you.
Since you're writing directly to the bits, I'd say get your image into a DIB section and select that DIB section into a device context. Then create a regular bitmap of the same size and select that into another device context. Then just blt from the one to the other. Now you could use the CImage stuff to save it to disk and not worry about the file format stuff.
Granted, this assumes you've correctly constructed the image in memory to begin with, which won't be the case if you don't properly align each row of pixels in memory. So, you still have to solve that problem, but this would at least do the file format stuff for you. Plus it opens up t he other file formats (.jpg, .gif, .png, etc.).
|
|
|
|