|
netstat -an gave me 0.0.0.0:9001 which is the correct port. The SerialForwarder server is ready made and I don't know how the port number is assigned in it. However, in the linux client I don't use HTONS to assign the port number, I assign the port number as 'addr.sin_port = 9001; '
Regards
islheg
|
|
|
|
|
Hi all. When making a socket program under Windows, would it be better to use a do loop over a while/for loop when you use the send()/recv() functions? Im just curious because im looking at some sources that have the do loop and a few while loops inside the function. Thanx in advance!
|
|
|
|
|
A better way to do this, if doing Windows API programming is to use the WSAAsyncSelect() API to send notifications to a window when any network events occur for a socket. Look at the documentation on MSDN here.
Hope this helps!
--PerspX
|
|
|
|
|
They basically do the same thing, only in slightly different manners. E.g., do{}while() and while(){} loops are exactly same except that the do loop executes at least once, because the condition is only tested at the end of execution.
Best,
Jun
|
|
|
|
|
Hi,
I have images coming to me very quickly, 200 pictures per second, I have all the BYTE arrays, and I need to do a lossless compression in realtime, is there any algorithm out there that can keep up with this, and is there anyway code samples that allow me to do this.
Thanks in advance.
|
|
|
|
|
The only thing I can think of that might keep up is RLE (Run Length Encoding). It won't give you that much compression, depending on the images, but it is light and fast. If you're talking sequential video frames then a frame difference algorithum might be better. I thought most people still used DSP hardware for this sort of thing
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi Godspeed,
godspeed123 wrote: I need to do a lossless compression...
PNG is a nice format - it is basically a compressed bitmap. It is available an PNG8 and PNG24. I don't know through put numbers for the realtime requrements.
I should probably be asking, what is the current format of the images?
Jeff
|
|
|
|
|
Right now they come in a byte stream, there is no format to them, its basically just raw data.
|
|
|
|
|
Where are you getting that frame rate from? if its a camera you might be able to get away with differences on the images, which would be a small performance hit but not nearly as much as converting it to PNG. My advice if you do wish to compress the images send the data to a grid for conversion to bitmap and then to lossless PNG.
-Steven Hicks CPACodeProjectAddict
|
|
|
|
|
I have a rather unusual situation where the monitor needs to present video capabilities (via DDC) that are actually less than what it actually supports, causing Windows configuration utilities to present a subset of options.
However, programatically I want to set video paramaters (resolution, refresh) to any of the actually supported configurations within the limits of the graphics card.
So, is there a way to determine the graphics card's capabilities, and to set them even though the system does not think the active display can support them? It seems that ChangeDisplaySettings will not allows settings that were not claimed to be supported (through monitor ddc exchange).
Thanks in advance!!
Jeremy
|
|
|
|
|
nonameseemstowork wrote: So, is there a way to determine the graphics card's capabilities...
What about GetDeviceCaps() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It appears that call returns information about what the display can do based on what it sent the PC during the DDC exchange. I have a case where there are 'non-published' configurations that the display can support. But ChangeDisplaySettings only allows settings that are advertised by the display through the ddc exchange.
Jeremy
|
|
|
|
|
Does anyone here know of a IEEE_754 math library implementation, Open source or free, in C++. Obviously it would need to be Intel/Win32 compatible but portable is better still?
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I create SDI project using CFromView is parent class and on the client area has list control.
I want to run this application in maximize but the list control doesn't
spread follow main windows.
Anybody know
How can I solve this problem?
|
|
|
|
|
What if you add a WM_SIZE handler to the parent window of the list control.
In response to WM_SIZE, resize the list control appropriately.
For example, here's a way to resize the list control to the full client area of its parent:
void CMyFormView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
ListCtrl.MoveWindow(0, 0, cx, cy);
}
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi All
I am using VC++6.0 for my project.I want to know how to change font of tooltip control from default font to other font. If any body have some hint or code then plz forward me.
Thanks in Advance
Atul
|
|
|
|
|
I answered to you but you asked again?
|
|
|
|
|
Hi all,
I wrote a database dll. The dll exports the whole class.
i.e.
#ifdef STATIC_LIBRARY
#define DLL_IMPORT_EXPORT
#else
#ifdef WIN32
#ifdef DBMODULE_EXPORTS
#define DBMODULE_API __declspec(dllexport)
#else
#define DBMODULE_API __declspec(dllimport)
#endif
#endif
#endif
class DBMODULE_API Database
{
...
class DBMODULE_API Recordset
{
But when I try and get hold of the class constructor in my calling application, I receive linker errors.
i.e.
...
Database db;
Recordset rs = Recordset(&db);
...
Can anyone please help me?????
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
|
Hello,everyone ,I'm here for your help.I wanna show a jpg picture with a picture control.At the same time, I want to use GDI (to draw)on the control,How can i do this?Thanks a lot.:-DThe sample will be appreciated.
|
|
|
|
|
Your best bet would probably be to render the JPG to a memory bitmap, then draw on the memory bitmap with GDI and display the result in the Picture control. The down side of this is you'll need to be able to un-jpeg the jpeg without the help of the control. Another option would be to subclass the control, override its handling of WM_PAINT to do the original painting and then add your own. There are lots of subclassing examples and tutorials about on CP and elsewhere.
No sample I'm afraid, it would be quite a lot of code and I'm notoriously lazy .
You could provide more details though of which picture control/language/libraries you're using. Someone out there is bound to have hit the same hurdle.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Except GDI you can use of this code
#include AtlImage.h
CImage m_Image;
m_Image.Load("c:\\file.jpg");
m_Control.SetBitmap(m_Image.Detach());
|
|
|
|
|
In additional see OleLoadPicture and on the codeproject see CXImage article,that article will be helpful for you.
|
|
|
|
|
Hi all
i am new in VC++.
could you please suggest how can i read a file or check file on internet on a remot system i am using http protocol to connect the system.
I have already tried this
<br />
HINTERNET hSession = InternetOpen( "HttpSendRequestEx", INTERNET_OPEN_TYPE_PRECONFIG,<br />
NULL, NULL, 0);<br />
<br />
<br />
HINTERNET hConnect = InternetConnect(hSession, argv[1], INTERNET_DEFAULT_HTTP_PORT,<br />
NULL, NULL, INTERNET_SERVICE_HTTP,NULL, NULL);<br />
<br />
<br />
HINTERNET hRequest1 = HttpOpenRequest (hConnect,NULL,<br />
upFolder, NULL, NULL,NULL,0, 0);<br />
if (HttpSendRequest(hRequest1,NULL,0,NULL,0))<br />
{<br />
while(InternetReadFile(hRequest1, &buffer, 1, &dwRead )==TRUE)<br />
{<br />
if (dwRead !=1) break;<br />
putchar(buffer);<br />
<br />
}<br />
}
But when the file does not exist on the remote system this code read the file. could u please suggest why it is happining.
There is any other alternative to check the file please suggest.
Saurabh Gupta
Software Engineer
|
|
|
|
|
Hello,
I am working on a application which runs in Window Mode. I am using Visual Studio 2003 for the developement. Following Setting control the mode of application...
Project Settings->Linker->System->SubSystem == Windows.
My task is to add some command line functionality in it. To make it possible I changes the above mentioned property to Console.
Project Settings->Linker->System->SubSystem == Console.
Now I am able to add the Command Line functioanlity and it is workign fine. Only probelm I am facing is that whenever I launch the GUI application a command window also launches. this behavior is quite obvious as application is a console one.
But I want to change this behavior, I do not want console window when I launch GUI and also want to keep the console functioality.
Here I would like to mention that, Conasole and Window version of the applicaion is mutually exclusive of each other and can not be used at the same time.
Thanks
Vikrant.
|
|
|
|