|
Thanks for reply, here are some error logs I get:
StoreError API Socket, WSAECONNRESET
Closing socket due to error, Socket index = 0
API Socket, Socket is null. SocketIndex -1 generates invalid socket
Server, socket link not found
API Socket, Connection accepted from 192.168.0.51
all happens in 1-2 seconds
the code is so big can't post in here.
Thanks,
Nahitan
|
|
|
|
|
Which side do you get this? The server or the client? And do you ALWAYS get it on that side?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Server, and I get that on server always, For client as I don't have the code don't know what happens!
Thanks,
|
|
|
|
|
Here[^] you can read the description for WSAECONNRESET:
Connection reset by peer.
An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.
My guess is that for some reason the client closes the connection (crashes?), or maybe "something" on the machine of the client closes the connection. Does the client maybe generate any log?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
On a side note, maybe try experimenting with the socket option SO_KEEPALIVE[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
HI,
How can I disbale or hide Maximize button from SDI application?
|
|
|
|
|
Adjust the styles[^] in your CreateWindowEx() call so that the WS_MAXIMIZEBOX value is not included. If you are using MFC then I think you may need to do this within your PreCreateWindow() method in your CMainFrame class.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hello Everybody,
I am trying to do like this.
loading a bitmap using Gdiplus and drawing that to a device context.
Bitmap gbmp(bmpFile);
Graphics g(dc.GetSafeHdc());
g.DrawImage(gbmp, x,y, Width, Height);
this is drawing the bitmap fine.
on the same device context, if i am trying to draw colors over the bitmap, then the colors are going backside of the bitmap and the bitmap is showing front.
in mspaint, if i load an image, and draw colors, its spreading the colors over the bitmap. i want to do like that. is there anyway to do that?
if i use BitBlt and SRCAND, then it is working fine, but i need in gdiplus.
Thanks in advance,
A. Gopinath.
|
|
|
|
|
Hi tagopi,
I would suggest that you have a look at the SetColorMatrix function[^] which can be used for RGBA transformations. Here is an example from one of my personal projects:
if(TRUE == m_bDisabled)
{
Gdiplus::ImageAttributes imageAtt;
Gdiplus::ColorMatrix cm =
{
0.299f, 0.299f, 0.299F, 0, 0,
0.587f, 0.587f, 0.587f, 0, 0,
0.114F, 0.114F, 0.114F, 0, 0,
0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 1.0f
};
cm.m[3][3]+=0.01f;
imageAtt.SetColorMatrix(&cm, Gdiplus::ColorMatrixFlagsDefault,Gdiplus::ColorAdjustTypeBitmap);
gScreenBuffer.DrawImage(&memBitmap,Gdiplus::Rect(0, 0, memBitmap.GetWidth(), memBitmap.GetHeight()),0,0,memBitmap.GetWidth(),memBitmap.GetHeight(),Gdiplus::UnitPixel,&imageAtt);
}
This example is used to paint my bitmap in grayscale when a button is disabled.
Good Luck,
-David Delaune
|
|
|
|
|
Hello David,
Thanks for your reply..
This works fine for me, i changed the values as needed by me.
Thanks again.
A. Gopinath.
|
|
|
|
|
Hello,
Can i able to save this image in disk (with the transparency i changed). i tried to save using bitmap.save, it showing black image.
Thanks,
A. Gopinath.
|
|
|
|
|
Hello,
I am a bit of a newbie with C++ and windows programming so I wonder if someone can help.
I am writing an app that needs to capture raw and then via an IPC pass that information on to another process. I have looked at using Global Hooks but unfortunately that are not going to work for me.
So what I want to know is... how do I go about directly receiving input from a USB keyboard into my Win32 C++ application?
Any help would be greatly appreciated.
Thanks
|
|
|
|
|
If your application must intercept keystrokes intended for another process then you've no alternative to hooks.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi mark8569,
As CPallini hinted you can use a WH_KEYBOARD_LL hook. You may also want to have a look at Raw Input[^] which is also capable of intercepting keyboard input.
Best Wishes,
-David Delaune
|
|
|
|
|
Hello all,
I recently moved from VS6.0 to VS2008.
I am trying to find a way to update an existing CRecordset derived class, from the DB table new structure (I'm using VS2008).
Since I couldn't find how to do this, I also tried adding a new CRecordset derived class, using the MFC class wizard.
Surprisingly, I couldn't find the CRecordset class in the class list to pick it from.
I've tried to find a solution for this over the web, but couldn't find any useful suggestion.
Please help.
Thanks in advance.
Eyal.
|
|
|
|
|
For adding a CRecordset derived in VS2008 you should do as follows.
1. In the Solution Explorer or Class View, right mouse click on the root node and choose Add --> Class.
2. From the Add Class dialog choose "MFC ODBC Consumer" and press Add.
3. Press the "Data Source" button to choose a data source and the required table (just follow the wizard).
4. Press "Finish".
5. Two files will be created CPP and H files.
Enjoy,
Dudi.
|
|
|
|
|
Hi Guys, I want to know the difference between User Mode and Kernel Modes (Drivers).
Can't we create Kernel Mode drivers with latest operating systems?
And what is the risk involved in using Kernel Mode Drivers?
Regards
msr
|
|
|
|
|
In the kernel Mode, all the program can run, it runs on the ring0 and can visit all the I/O port.
In the user Mode. only a part of program can be run. It runs on the ring3. Some operations of the program will be fobidden.
我爸是李刚
|
|
|
|
|
yu-jian wrote: In the kernel Mode, all the program can run, it runs on the ring0 and can visit all the I/O port.
What does all the program can run mean? In kernel mode your code runs at ring 0, so you can use privileged instructions of the processor, but you have too much constraints. For example you can call only a subset of the system API depending on the IRQL your driver is running on.
yu-jian wrote: In the user Mode. only a part of program can be run. It runs on the ring3. Some operations of the program will be fobidden.
What does this sentence means? At ring 3 you cannot use privileged instructions of the processor: if you try to use them an exception is thrown. Said that there are no limits on which parts of your code could be executed or not.
|
|
|
|
|
msr_codeproject wrote: Can't we create Kernel Mode drivers with latest operating systems?
Yes, get a copy of the Windows Driver Developer Kit[^].
msr_codeproject wrote: And what is the risk involved in using Kernel Mode Drivers?
If your driver breaks the rules it breaks the system.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi
I have an application that runs fine in XP, and also in Vista on my laptop. However users are reporting problems in Vista, particularly concerning saving files and this message when they quit the programme:
"This application has requested the Runtime to terminate in an unusual way"
I presume this is something to do with me having installed Visual C++ 2008 on the laptop, so I have certain libraries or files that other users don't.
I know this is a bit vague, but I thought someone might recognise the problem.
Thanks in advance if you can help.
Greg Chapman
|
|
|
|
|
|
I don't know Vista much (stayed away from it) but it could also be access right issues. Like, when you boot your vista you log in with an admin user and have all the rights to write everywhere and anything, but when your users log in as normal users, your progran no longer can read/write to certain parts of the registry, the filesystem and who knows whatnot.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Thanks for your replies. It would be a shame if I had to include the distributable package - I think it would put me off installing a little shareware app; and most things work OK. I'll try and explore the access rights idea - but it's hard to find bugs when they don't occur on the development machine!
Cheers
Greg
|
|
|
|
|
Instead of linking against the DLL version of the runtime, link the runtime statically. It will make your image larger but remove the need to includes / install the redistributables.
|
|
|
|
|