|
yes
a pretty hard way:
if you know api hooking you can hook urldownloadtofile function you can find it in urlmon.dll and when something downloads you can display a message box on the screen and you can allow the download by letting it return what it wants or make it return a error and thus end the download before it begins. But of course they might still be downloading throught plain winsock instead of urldownloadtofile and you should probably try to hook some functions like recv also.
a even harder one wich I never did just heard about:
if you don't you can write a driver with the use of the winddk that acts just like a driver but filters connections.
I know no other ways but there might be lots
for more info on api hooking search here on codeproject a article by a russian person and also one by a chinese person but I forgot their names sorry.
One article is something about disabeling ctrl alt del and contains a very good api hooking class.
you should look at that.
|
|
|
|
|
Thanks,
I will look in to this and I hope it will work, If you have any more information please feel free to help me.
|
|
|
|
|
Hi everyone,
Hot to show two dialogs simultaneously from a CMainFrame class?
I hope that they help me.
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
As long as the dialog boxes are modeless I guess you could just make two calls to Create and position the dialogs in a tiled fashion so neither overlaps the other???
Cheers
How do I print my voice mail?
|
|
|
|
|
|
Hi all, I'm writing an expression parser using Baur and Zamelzon algorithm, but it seems that it can't handle unary minuses correctly What shall I do, does anybody know some algorithm that can parse unary minuses correctly ? Don't offer reverse notation, it has the same problem
|
|
|
|
|
I dont know if this is the right place to post this .
Using Chris Maunder's MFC Grid control 2.25
I need to use it in an SDI application .
and I need to create it dynamically .
I didnt know how to do this .
Plus I need the Grid in a class that is already derived from CWnd
CSCreen(derived from CWnd)
^
|
|
CMyNewClassWithMFCGrid
Has anybody have any tips on doing this ?
Thanks
|
|
|
|
|
I have a win32 dll which is called by a GUI app . Once the dll is called, a whole ton of work is done in it and then it returns, and the app is done. This takes a long time and since my dll is not an mfc one, I dont have any progressbar window popping up. (Actually I dont even know if you can have guis in a dll). How do I indicate the progress in my dll? The main app has absolutely no idea of how long things will take.
Thanks,
sb
|
|
|
|
|
ns wrote:
(Actually I dont even know if you can have guis in a dll)
Yes you can.
ns wrote:
How do I indicate the progress in my dll?
How you do it (thie GUI) is completely dependent on the nature of the long operation
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
The right (imho) approach to solving this common problem is to make the GUI an "observer" of the "worker" DLL. The worker notifies its observers of various "events" (typically progress) as it does its thing. The observer can choose to ignore these events or respond to them in any way it sees fit.
An "event" is anything that describes an action - it can be as simple as an int or as complex as a class containing several members such as event type, percentage progress, and other information describing the worker's current state.
An observer is nothing but an interface that exposes a method like:
bool handleEvent
(Event* pEvent);
The observer returns false if it wants the worker to stop further processing. Using this simple design pattern, you could implement a user-friendly task timer/progress dialog as described in this[^] article. What could be cooler?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Isn't that somewhat re-inventing the wheel since the Win32 Progress Control already implements the pattern?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
palbano wrote:
the Win32 Progress Control already implements the pattern?
Huh?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
I think you may have misunderstood my point.
It's good design to dissociate a worker (whether it's a thread or just a helper function) from the GUI. A worker simply relays information about its state to interested parties, at significant points in time.
The observer pattern abstracts the mechanism of event delivery. An observer can be anything - a GUI (i.e. a CView or CDialog class which will likely update a progress control), a logger (which could log events to a persistent store), an alterter (which could terminate the worker under certain conditions), a profiler (which instruments the worker's operation), etc. The observer/event mechanism I alluded to is OS-agnostic. It doesn't post Windows messages - it simply relays events.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
I think you may have misunderstood my point.
No, but i understand why it looks that way
I don't acutally disagree with your point.
It just seems that posting windows messages is the same as relaying events and the relationship between a progress control and a worker thread is very similar to the Pattern.
So i thought i would post the question and see what others thought about it. I am certainly not implying your post was wrong. I apologize if it looked that way.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
http://www.codeproject.com/threads/usingworkerthreads.asp[^]
I think what Ravi had in mind was you placing a worker thread function in your DLL. Have that thread post progress messages back to your main GUI app. The main GUI app will update the progress bar.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
|
LPWSTR a_string1 = _T("abcde");<br />
LPWSTR a_string2 = _T("fghij");<br />
a_string1 = a_string2;<br />
Will the string which is pointed by a_string1 become zombie and cause memory leakage?
Thanks
|
|
|
|
|
No. When the string goes out of scope, it's memory will be free (99.9% sure).
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
No. String literals are not allocated on the heap.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Run the program in Debug mode.
If there is a memory leak, it will be displayed in the output window.
|
|
|
|
|
Can a string literal cause a leak?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
of course, this CAN'T make a memory leak. the strings are alocated on the stac and cleared automaticly.
|
|
|
|
|
thank you Hopefully vcplusplus is reading
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
it is a dll
cannot be debug
anyway, i believe it will be cause memory leakage as the friendly guys who are replying me ^^.
|
|
|
|