|
sirtimid wrote: hProcess = OpenProcess (PROCESS_ALL_ACCESS | PROCESS_TERMINATE | PROCESS_QUERY_INFORMATION,
FALSE, pe32.th32ProcessID);
if(!memcmp(pe32.szExeFile,"sqlservr.exe",12)) {
Shouldn't you be checking the return value from OpenProcess() before attempting to call memcmp() ?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
It is probably a service that can be shutdown using the service manager.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi
I have used the BannerTester project given at
http://www.codeproject.com/staticctrl/bannerstatic2.asp
Here when I increase the size of the Font, it becomes very very slow speed.
I want to increase the speed of the text...is there any idea how to achieve it ?
Regards,
Mahesh
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Why don't you post the question on the 'forum' below the article ?
|
|
|
|
|
ohhhh i c...thankx a lot...
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
|
hi,
Can you plz tell me how to Convert CString to LPCTSTR.
Thanks a lot.
|
|
|
|
|
this[^] is the only thing I can give now...
learn how to search the web and the msdn if your not satisfied
-- modified at 9:57 Wednesday 12th October, 2005
|
|
|
|
|
toxcct wrote:
CString str = "Hello World";
char* pc;
strcpy(pc, (LPCTSTR)str);
While I understand the intent of your code, there are two things wrong with it. First is that no memory has been allocated to pc . Second, the cast in strcpy() is not needed.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I am really sorry Mr. toxcct. Usually i search for article and i search in forum. But this time i didnot find anything in message search (LPCTSTR and LPCSTR string miss match). And its my mistake that i just overlooked the thread below.
And i am happy that first reply of those threads posted by Rage helped me.
Thanks and Sorry
|
|
|
|
|
ok, no problem now...
what angry me the most is seeing that i am flamed when i'm trying to help someone...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
thanks !!!
i really can't understand people on the forum...
i've been vote down one more time while i gave the answer...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Well, if you are referring to your previous answer in this thread it could be the fact that the code you wrote will generate a compile time error.
You're suggesting assigning a 'const char*' to a 'char'.;)
On the other hand the answer should give the one asking the question the idea anyway, so I don't think it deserved to be rated '1'.
I'll rate it up for you a little bit, if you want.
--
Roger
|
|
|
|
|
thank you very much, you're too good
i corrected my wrong code, but i just wanted to show how to use the (LPCTSTR) cast operator...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Not meaning to be picky, but that code won't work either as you're copying to a pointer that doesn't point to anything.
But that's not the point. Your original "look at the other threads" comment was valid, which is why I voted it up earlier :]
|
|
|
|
|
icabod wrote:
But that's not the point. Your original "look at the other threads" comment was valid, which is why I voted it up earlier :]
visibly, not everyone understood that we were talking about the use of the (LPCTSTR) cast operator...
I really don't see why i continue awering/helping people that don't take 1 minute of their time to see if their question is not already on the last 50 ones on the forum ...
such behaviors sucks... (and i don't care to be voted down for this... )
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I work on a single document app. Now I have the problem that messagehandling doesn't work right. I want to activate the creation of a new document from another point as the main menu and toolbar. For that purpose I included
ON_COMMAND(ID_FILE_NEW, OnFileNew)
in a view class and tried to start the OnFileNew() function by sending a message to the view class:
pvw->SendMessage(ID_FILE_NEW)
It doesn't work! When debugging the whole matter I saw that OnFileNew() wasn't activated (and processed). Even if it does, I have to do all by myself (setting default name for empty document and so on).
How can I activate the applications OnFileNew Funktion? Why doesn't the message sending work?
I hope someone helps me with that (basic MFC) matter.
|
|
|
|
|
well friend,
i will not go in detail of message handling, but i will concentrate on your basic problem of Starting a new document whenever you click File->New.
When you use App Wizard and create a single document app, it automatically does it for you.
And if you wnat to do something else on file->new (like automatically saving the previous file without prompting etc anything) then you and Message handler using the Class Wizard to your Mainframe or any view class.
Hope that make things clearer, if not make post.
hey did you forget to rate? Plz rate my reply.
|
|
|
|
|
I did not make me clear enough. I used the App Wizard and clicking the New Document button or selecting it in main menu works.
I want to start it from another point too. For example a context menu or from another button. If there is a button in another toolbar that launches a funktion that requires a new document, I have to call the OnFileNew Funktion. But it doesn't work at the moment.
How can I create a new document from within own classes or functions?
|
|
|
|
|
You have to send or rather post a WM_COMMAND message with ID_FILE_NEW as parameter to your view class.
Hope this helps
--
Roger
|
|
|
|
|
Thank you! It works!
The right answer is:
AfxGetMainWnd()->SendMessage(WM_COMMAND,ID_FILE_NEW);
|
|
|
|
|
I need free VOIP library,
for implementing by me peer-to-peer call application,
as SCYPE does,
but without third party managed MAIN servers,
server - must be mine, - with availbale code or does not need.
are there such a libraries, with some good quality ?
Thanks you
|
|
|
|
|
hi
I am facing this problem that the windows in my application get distorted<the controls="" which="" usually="" come="" on="" them="" dont="" fit=""> after I increase system's DPI settings to maybe 120.
I want to resolve this problem through coding(c++).
I found a useful article for the same http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngdi/html/highdpiapp.asp
Please help.
Regards
Atul
|
|
|
|
|
I'm using SendInput to control the mouse however I've found a funny with it.
If I move the mouse to the left and then to the right by the same amount then the mouse pointer returns to its initial position. However if I move the mouse to the left and then send a left button down (to initiate a drag action) and then send a right action the mouse pointer moves a lot further than it should (probably around 1.75 times more than expected).
Has anyone came across this before and have any solutions to it?
TIA,
Andy
|
|
|
|