|
In C++ I would strongly recommend avoiding the Winsock control. It's designed for environments like Visual Basic that can't do multithreading and as such is a real pain to use for connection-oriented sockets.
Instead I'd recommend that you just use the Windows Sockets library directly.
A useful resource is the Winsock Programmer's FAQ[^].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Where is this information stored ?
Is there an interface to access it ?
|
|
|
|
|
If you have a handle to the window, you can use GetWindowRect() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How is XP/2000 WDM driver code different from WIn98SE WDM/WIn95 OSR2.1 WDM?
Tell ME why
|
|
|
|
|
Win95 does not support WDM!
Win98 supports WDM, but there are slight differences between Win2k/XP and Win98.
Don't try it, just do it!
|
|
|
|
|
I am using Visual C++ .NET 2003 and made a MFC multiple document application with a form view (CFormView). On that view is placed an edit box to which I connected a CString variable (including all those "DDX_Text(pDX, IDC_EDIT_NAME, m_Name)" etc.). In addition my application has keyboard shortcuts, defined in "Accelerator" in the ressource editor.
The problem is that those shortcuts interfere when I want to enter a text into the edit box, e.x. my shortcut keys don't result in a letter in the edit box but do the shortcut stuff (opening a dialog, etc.).
Is it possible to somehow override/disable all the keyboard shortcuts when the focus is on the edit box? If that's possible I could catch ON_EN_SETFOCUS and ON_EN_KILLFOCUS in the form view and disable and later enable again the accelerators.
Or do I have to write my own control derived from CEdit? (hopefully not...) Will the accelerators still have priority over my own control then or viceversa? (if yes even an own control won't help...)
Thanks & Bye,
T.T.H.
P.S.: I searched Codeproject on this problem for over an hour by now...
|
|
|
|
|
Error :
The process cannot access the file because it is being used by another process.
|
|
|
|
|
Pretty self explanatory error really.
Do you have any handle open to this file?
Is this file a DLL or an executable and is running at the moment?
Is it open in another application? Excel for instance does not let you delete a file while it is open with it.
Hope this helps...
|
|
|
|
|
well,
This file is normal text file and even if that is locked by any other process I want to delete it .
|
|
|
|
|
vikrams wrote:
even if that is locked by any other process I want to delete it
That a bad idea, you know?
Beside being a security breach (one process taking away a resource of another), it would lead to any amount of unstability: Your program youd not be sure about the 'openness' of a file it just opened, and had to check before *every* access.
Even then, there would be cases where the file disappeared between checking and access.
No, file locking is OK as it is.
Find the offendig process and end it.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Have a look on codeguru.com for a program named forcedel.exe, if I remember correctly it comes with source code.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Hi!
Sorry, but I can speak English only a bit.
I have a little problem. I would like to display an image (GDI+), display a text and I would like to save them.
Graphics graphics(lpDrawItemStruct->hDC);
graphics.DrawImage(pDoc->bitmap,...);
graphics.DrawString(...);
Up to this point OK.
And after that I would like to save them!
(in a Doc/OnSaveDocument):
bitmap->Save(...);
But only the image saved after that. How can I save both the image and the text?
How can I copy the text into the pDoc->bitmap?????????????
Please help me! Thanks!
|
|
|
|
|
There are some very good articles at codeproject on GDI+ programming; they should answer your question.
It sounds like you are drawing the text on a copy of the bitmap and not the original bitmap. If you draw the bitmap on a window and then draw text onto that image, then you are not drawing on the original bitmap (image). What you need to do, is draw the text on the original image or copy the temporary image to the origianal image.
I am not sure how this is done with GDI+, but it is easy to do in GDI.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
So I would like to save the original image with the text. I have a DC and I draw onto an image and after that I draw a text too. And I would like to save them together into the original image.
Please help!
|
|
|
|
|
Some thing like that.
Basicaly (GDI using MFC):
1) CDC dcMem;
1) dcMem.CreateCompatibleDC(NULL);
2) CBitmap* pOldBmp = dcMem.SelectObject (your_bitmap);
3) dcMem.TextOut(x,y,pStr);
4) dcMem.SelectObject(pOldBmp);
The original bitmap has now been modified and can be saved, with changes.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Thanks!
I'm try it, but there is an error:
CBitmap* pOldBmp = dcMem.SelectObject (your_bitmap);
error C2440: 'initializing' : cannot convert from 'void *' to 'class Gdiplus::CBitmap *'
What's the matter?
|
|
|
|
|
I used your code, but the TextOut didn't display the text, and didn't save it. What's the matter?
|
|
|
|
|
Well, I expected you to do a little reseach (not depend on just what I said [although is was correct]).
What I gave you, would change the bitmap stored in memory. It, of course, did not save anything. After you have changed the bitmap, how you save it is up to you. A non-C++ call to TextOut is (would be):
TextOut(hdc,x,y,lpString,cbString); // where cbString is number-of-characters.
Please do us and your-self a favor: Post a minimum example, that shows what the problem is.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hello,
Is there is any Windows Equivalent of these Runtime Function memset(), isdigit(), malloc(), realloc(), atoi().....
any Article or Link related to this would be Very Great Help!!!
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
I am not sure I understand your questions as these functions exist in "Windows" and if by this you mean Visual C++.
Hope this helps,
|
|
|
|
|
Hope So,
Actually these function which I have mentioned above i.e. atoi ,memset etc are defined in MSVCRT.dll I just looking for windows equivalent for these function.
For e.g. equivalent of strcmp in windows is lstrcmp .now, you must be wondering why I required that, first to reduce dependency of MSVCRT.dll and second reduce the size of executable .
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
ThatsAlok wrote:
...to reduce dependency of MSVCRT.dll...
Which is really just a misnomer. You either have a dependency on a DLL or you don't. There is no in-between (i.e., reduce). If you use even one exported function from a DLL, the DLL in its entirety is mapped into the address space of your application. And since MSVCRT.DLL is probably already mapped to other applications, one more is irrelevant.
To get a better understanding of file and process sizes and how they differ, I suggest reading this article.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
ThatsAlok wrote:
reduce dependency of MSVCRT.dll
I'm pretty sure lstrcmp() ends up calling strcmp() .
[edit]
I was wrong. lstrcmp() is contained in kernel.dll . It's a separate function because it works differently from strcmp() .
[/edit]
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It is very hard to get away from the MSVCRT.dll, since many (if not most) libraries depend on it. Therefor, you will probably be dependent on it even if you do not call any of the standard C-functions that it contains.
When designing a COM control: You have the option of defining minimum dependencies, which attempts not to include MSVCRT.dll, but I have never been able to eliminate that dependency my self.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|