|
I guess you're right, can't know unless I have tested it. But I remember throwing ME out the window because it would always hang, crash, destroy my cd's when I was burning, the list goes on and on. I especially remember when I first started programming this app and the scroll bar of the list box was so jerky as if it was using up all of my resources. As soon as I installed XP, my problems disappeared!
|
|
|
|
|
Heheh, ME sucks. No argument about that. But that is "the user" side of me talking. "The developer" side of me says "life sucks, you have to support it".
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
Yeah, ME has its problems but you still can run regular apps on it, like Word, Excel, etc. If your app is acting weird then there's probably something wrong with it. The fact that it's OK in XP is likely because XP has a much greater tolerance for resource leaks. Remember, XP is based on 2000, which is based on NT, and NT is not nearly as limited when it comes to resource use (and abuse) as 95/98/ME are.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Hi!
I've got a template class which basically implements the functionality in a dialog. Now I must use a callback function which requires a pointer to the class.
The callback function is a global function outside the template. How do I cast in this function from a LPARAM to my CTemplateWhatever<cdlgwhatever> pointer? I dont have the template specifiers because its outside my template class.
Any ideas?
template<class _Ty> void CTemplateWhatever<_Ty>::UsesCallback()
{ DoSomething(Mycallbackfunction, this); }
void Mycallbackfunction(LPARAM a)
{
}
|
|
|
|
|
You have two options here (to the best of my knowledge):- Derive
CTemplateWhatever from an abstract class with all the virtual methods Mycallbackfunction is interested in and cast to that base.
- If you can afford it, templatize
Mycallbackfunction like this:
template void CTemplateWhatever<_Ty>::UsesCallback()
{
DoSomething(Mycallbackfunctionwrapper<_Ty>::f, this);
}
template <_Ty> struct Mycallbackfunctionwrapper
{
static void f(LPARAM a)
{
CTemplateWhatever<_Ty> *p=
reinterpret_cast<CTemplateWhatever<_Ty> >(a);
...
}
}; A template class wrapper is preferred to directly templatizing the function because of a VC++ bug that makes it impossible to explicitly indicate template parameters for a function.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks. I solved it similar, just a bit simpler with a function template for the callback. Works fine for me.
Error 4711: Signature expired
|
|
|
|
|
|
No, thats fine. I've got parameters and that specific function is instantiated just once (per app).
Thanks a lot.
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
how can we get the Id of the computer processor ?
|
|
|
|
|
|
Can someone give me a simple(just the skeleton) Windows Messenger addin source code (IMessengerHeadlines or something else) please?
Thanks...
|
|
|
|
|
hi!
I needed to implement a schema wherein one Property Sheet is displayed over the other, although with a slight offset. (Please note that both sheets are modal).
Any help will be highly appreciated.
Regards
Richard
|
|
|
|
|
Hi All,
How can I check for timer id whether its already running or not...I m using SetTimer() more than once to start the same timer so I want to chk it before invoking SetTimer()...Please help me.
Thanks in advance
Prateeti
|
|
|
|
|
You can use a flag to set to TRUE when you call SetTimer() and when you call StopTimer (or what function it is) you set the flag to FALSE.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hello all,
I need to know when the user stops my app. from the "task administrator" using "Stop process" (Ctrl+shift+esc makes that window appear (I don't know if I have translated the window name properly )).
Thank you in advance...
|
|
|
|
|
You can't do it. Hmmm, maybe with help of debugging APIs, but it's still too much trouble.
If you need a fast solution: a workaround for this would be creating a second application that monitors the first one. The first opens a file and locks it for exclusive user and the monitor keeps trying to open the file for exclusive use too. When it succeeds, the first application has been shutdown.
If you think the user can shutdown the monitor application, you can have both applications monitoring for each one.
The file locking is only a sample and can be substituted for any Windows object that can be created on a global context, like mutexes.
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|
|
- what about finding a window caption?
FindWindow(NULL, "Caption of the window to look for");
- I will pause the machine, wait for a complete pause, delete all the program files (my program files) and shutdown the PC if I discovers that a wrong code has been entered, one of the two apps has disappeared, the expiration date has been reached, or the date has been changed to a littler one.
Do you think that it could work? I've tested all the other stuff and it's fine for me, now I'm trying to find the window caption...
|
|
|
|
|
Besides the problem that FindWindow may hang your application, it's an ugly way of being noticed about the other application's shutdown.
Furthermore, are you doing this for software protection?
Well:
Joan Murt wrote:
I will pause the machine, wait for a complete pause, delete all the program files (my program files) and shutdown the PC if I discovers that a wrong code has been entered,
1. Hmmm. In Windows NT and later, I can run the program under an account that do not have the right to do it.
2. Most users just love having their machine purposedly paused or shutdown. I would sue anyone who did this stupid thing in one of my servers. I don't know how are the laws in your country, by brazilian laws, I would make a lot of money.
3. It's easy to create another window with the same caption.
4. It's easy to crack your application. Actually, it's easy to crack almost any application. Spend more time doing useful features and your users will be happy in pay money for you. Mess with their trust and you'll bankrupt.
Excuse me, but I'll not help anyone in creating such a stupid protection scheme for a lame piece of code.
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|
|
I'm not agree with you...
You've not understood what machine means... my machine is not a PC, is a metallic prototype that weights 11 Tons and that's used to create pieces of reciclated paper transforming them from the liquid state (paper mixed with water) to their final state pieces of dry paper with the desired shape.
And yes I'm doing this as a "preliminar" protection, because I've done a service that installs a keyboard system wide hook that prevent the user from leaving my application, that is a numerical control application that fully controls the mentioned machine. (Ctrl+alt+del too), but I've discovered a couple of keys that are missed in my service and I must modify it...
Moreover that prototype is not still completely payed (the machine is not still paid we must stil earn 18000 €)... and as the director of the IT department I must ensure that our customer will pay.
- If I shut down the application I delete all the files after pausing the 11 tons machine (in order not to harm the machinery) and close the computer (by now).
- If I detect an incorrect password to enter to my app. I do the same (by now) (this is done in order to prevent a possible closing method that I don't know and that hacks the closing traps that I have placed... (by now)
- If one of the windows are closed then I do the same (by now).
- I'd didn't thought of that... (another window can be created with the same name...)
- Thank you for your help, I'll look for more than one window with the same caption too...
NOTES:
- the PC starts under Win2k and do it automatically, without needing to introduce a pwd.
- OK, I'l spend more time doing interesting things... what do you think of making machines speak, making machines move, interpolate 256 axes in a machine with only one industrial computer (and so other easy things?)
- I do a good job, I'm sure that it could be better, nobody's perfect, but my enterprise machines are good, and ones of the reduced group of machines with windows interface, remote connection, wizards that help the user to program the movements, and so on...
I don't need anybody that tells me what do I have to do, I need somebody that can help me answering questions (as I try) and giving me ideas like yours that 2 windows with the same caption can appear...
I'm not doing this for pleasure, I need to do this in order to ensure that my enterprise will earn it's money.
After saying all this.
Thank you for your suggestion, but please, don't think that the person who asks is always stupid... remember that an expert in anything is who has done all the mistakes of that thing.
Regards.
|
|
|
|
|
Sorry, I really misunderstood you. I'm just sick of people doing this kind of thing. I've seen a production server of a customer of mine being completely killed by a stupid notepad-like editor whose protection system's author has failed to understand that sometimes a drive letter is not a physical disk.
Joan Murt wrote:
Moreover that prototype is not still completely payed (the machine is not still paid we must stil earn 18000 €)... and as the director of the IT department I must ensure that our customer will pay.
So you can afford $50 and buy a HASP4-Time. It's a hardlock with a embedded timer. Can be remotely programmed with codes, and all gizmos you may ever need. With 18000 bucks involved, one could spend 100 bucks and pay a teenager to hack it. Hardlocks are not impenetrable, but it will offer you more security than we'll ever dream of creating. You just run envelope.exe on your executable and you're ready to go in 5 minutes. BTW, I'm not afiliated to them in any way, just a happy customer
Joan Murt wrote:
I don't need anybody that tells me what do I have to do, I need somebody that can help me answering questions (as I try) and giving me ideas like yours that 2 windows with the same caption can appear...
I still urge you to create a solution based on mutexes. It will consume 0% CPU and the "kill" detection will be instantaneous. The FindWindow can crash your application if other application in the system is not pumping windows messages, because it calls GetWindowText for doing things.
No window-caption solution will be safe for software protection. I can pause a process[^] and launch another one.
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|
|
Sorry for my impolite answer...
I'm very nervous due to the pressure that suppose all that money involved...
I'll take a look at that solution based on mutexes... I'm happy to have the Advanced programming for windows from Jeff Richter that gives great samples about that...
Sorry again, and thanks for helping me.
I promise I'll take a look at HASP4-Time it can help me.
I'm so sorry for having react in that way.
|
|
|
|
|
Boy! Joan,
you really got p***** here.
|
|
|
|
|
I've got a CHtmlView from which I need to detect when a user clicks on a link and what the URL is. Overriding CHtmlView::OnBeforeNavigate2() gives me this information most of the time, except when the user opens the link in a new window.
CHtmlView::OnNewWindow2() gives me an IDispatch for the new window but I'm not sure how to get the URL from this.
Can anyone help me out here...?
|
|
|
|
|
I would like to ask if anyone knows a better way to send an e-mail than my current situation. I have a static control on an About Dialog which has my e-mail address which if of style NOTIFY so I can process the message. In the message I have WinExec("explorer mailto:georgiek50@yahoo.com", SW_MAXIMIZED) because that's how HTML does it...which worked fine, hotmail opened up and everything but it also opened up another window (explorer) with a title "No Page to display". Is there a more straightforward way of doing this?
|
|
|
|