|
Patch random bytes in the EXE until you find something that works
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Of the top of my head, can't think of a way in C, but in C++ you can simply use some form of static initialiser.
Be warned though, that they can cause problems if not handled correctly. I'd recommend asking yourself if you really need to do this?
Kev
|
|
|
|
|
Pls elaborate "Static initialiser ".
Small code can be of help.
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
1. Get yourself a sledge hammer
2. Take a deep breath
3. Swing the hammer back and give the program (The display, where it is being shown) a merciless blow.
4. The program should have crashed by now.
This is a code sample
<br />
#include<iostream><br />
using namespace std;<br />
<br />
class GoGoGo<br />
{<br />
public:<br />
GoGoGo() <br />
{ <br />
cout << "This runs first!";<br />
} BeFirst;<br />
}<br />
<br />
int main()<br />
{<br />
cout << "Main is second :(";<br />
return 0;<br />
}<br />
Google for interview questions and u will find a lot of stuff. I learned this from google some months back.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
What about C ???
this is c++
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
You need to declare an instance of class GoGoGo before this will work - i.e.:
GoGoGo executesBeforeMain;
Kev
|
|
|
|
|
It has to be
class GoGoGo<br />
{<br />
public:<br />
GoGoGo()<br />
{<br />
cout << "This runs first!";<br />
}<br />
}BeFirst;
never say die
|
|
|
|
|
Sorry abt that. Din notice it.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
int CrashingFunc();<br />
<br />
static int SomeIntThatCrashesTheProg = CrashingFunc();<br />
<br />
int CrashingFunc()<br />
{<br />
}
The static variables will be evaluated first and this will call your CrashingFunc before the main()
|
|
|
|
|
is it neccesary to put static .
static int SomeIntThatCrashesTheProg = CrashingFunc();<br />
<br />
int CrashingFunc()<br />
I feel int SomeIntThatCrashesTheProg has to be Global which u have defined with static
never say die
-- modified at 9:27 Wednesday 11th January, 2006
|
|
|
|
|
yeh globals
if they are initalised then
they can crash the prog .
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
Why do you want to do so? Can you tell the usability?
Vipin - MVP
|
|
|
|
|
Actually i dont want to crash the
program but i am studying the reason
by which the programs can crash before
the main function is exectuted
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
vikas amin wrote: i am studying the reason
by which the programs can crash before
the main function is exectuted
If so, you will do a never ending study. Atleast after you start with windows programming. (If you ever finish studying this with C and C++)
Why do this dude? Destructive mind huh?
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Hi Friends
I have developed an application(MFC based ) in which first I have my object of one class say objMyClass in one file called File1.h and I have used it in File1.cpp.
NOw I want to used the same object(I don't want to create new object) in my another file say File2.h and File2.cpp....how to do that ?
Any clue ?
Thankx a lot
Mahesh
|
|
|
|
|
Use extern
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Is it possible to use extern for Objects also. I know we can use it for variables but not sure for object.
Also what I want mainly is I don't want to create new objects I just want to use that same object in it's present state.
And last but not the least, Thankx a lot for answering my question and taking time for it.
Regards
Mahesh
|
|
|
|
|
Yeah mahesh extern can be used on objects too.
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
even u can extern with function.As function r global by default unless u have not put static with function declaration
never say die
|
|
|
|
|
Hi All,
I am faced with a situation where a window from my application needs to handle events the notifications for which are going to another window.
Can someone tell me how I can make my window get the event notification?
More specifically, the issue is regarding the Drag and Drop implementation between my namespace extension and windows explorer. I need my namespace extension to get a notification that a file has been dragged from here and dropped on a particular "Windows Folder".
Thanks in advance,
Regards,
Anil
|
|
|
|
|
|
|
Dear All,
I want to Dispaly some user Names on "Computer Locked" Dialog Box at Win XP.
I will Display the the users statically or dynamically while computer is Unlocked.
Pleae help me how I can achieve it.
With Regards
Manoj
|
|
|
|
|
Are u creating Custom Gina .Or hooking the msgina
never say die
|
|
|
|
|
Dear Sunit5,
My First Target is to custamize the exiting GINA statically. Some one suggested that you can directly modify the existing dialogs by opening it in VC++ Stdio. But I am not able to open the GINA Dialogs in VC++ stdio.
Please let me know How I can achieve it.
2nd Target is to modify GINA dynamically or using another GINA DLL which may be I can achieve by writting GINA DLL as described in "Building and Testing a GINA DLL" in MSDN.
I am using Windows XP.
Thanks and Regards
Manoj
|
|
|
|