|
You didn't say for what protocol, but if you are talking about HTTP, try looking at HKEY_CLASSES_ROOT\http\shell\open\command.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
How to set the sound channel volumes and (un)mute those channels using the Windows API?
|
|
|
|
|
|
hi ,
does anyone has any idea about the conversion of .bmp/.jpg to .pcx format.
Any idea about any classes will also do
Thank you.
Satadru
|
|
|
|
|
|
When the trial period of my app has expired (jtodaysdate - jinstalldate) plus some other things I better not mention here. Should I?
Write to the executable a bunch of 01010101010101
or set a GUID mutex atom to a instance of the os?
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
The best way to implement a trial period schema is to use some method that modifies the application executable itself. This way, a peep who'd want to hack your trial protection would need to have solid understanding of assembly and reverse-engineering.
Of course, the securest method would be a combination of executable modification, registry keys and INI/DLL-files.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
OK Great,
I have lost faith in folks ability to be honest.
I posted my static ip on codeproject by accident in a response and have gotton 82 hack attempts so far, none got through.
Anyway I thank you and understand the reference to dll and ini and have implemented them.
I guess I will write 0's 1's to the executable also.
If I set the GUID of the mutex to the guid of the os and only allowed 1 instance that would be cool, also!
Great answer thank you!
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Neither,
I would think you want to show nice dialog: "Trial period expired", visit <company> website to purchase licenses and get free upgrades.
Writing over executable with "0101" is childish and not productive. On the day X user could have clicked on your executable by mistake and closed app. Next thing he/she knows application exits w/o warning... Is it broken? Messed up?
Would writing over executable stop even novice hacker? I doubt that. All it takes to nop area "call WriteFile[A]"...
Brian
|
|
|
|
|
Yes sure and I can go around a dlgbox in half a minute, so can you I guess, but I think I will stick with an original plan.
Look at the cracks available on the web for what you are advocating.
Thank you for the response.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Hi,
i need to export some classes in DLL created in VC++, which is fine. I understand how to use exported functions in VC++ dll from VB, but how is it (if) possible to use exported classes from VB?
I could not find any articles in MSDN / web regarding this. I would greatly appreaciate if somebody can direct me, where to get more information on this.
many thanks
Aby Philip
|
|
|
|
|
The question arises: are you willing to export an object of the class from the DLL, or the definition of the class ?
If it is the first one, then may I suggest that you create a global object inside the DLL's code, and export a function from the DLL which returns the address of this object. This, however, requires that you have the definition of the class available at the loading application in order to use it. I do not know for sure how well you can use C++ header files in a VB project, or if there is a conversion available.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
hi friends,
i have a c++ program like this :
#include "iostream.h"
int main()
{
cout << "John" << endl;
return 1;
}
The program will print "John" on screen.
Now my problem is that i want to print "Hello John Bye" on the screen without changing anything inside main function.
CAN SOMEBODY PROVIDE ME THE ANSWER.
|
|
|
|
|
#include "stdafx.h"
using std::cout;
using std::endl;
class CTest
{
public:
CTest()
{
cout << "Hello John bye" << endl;
exit(0);
}
};
int main(int argc, char* argv[])
{
cout << "John" << endl;
return 0;
}
CTest test;
|
|
|
|
|
Hi Imran,
It will print ,"Hi John bye John" but i need "Hi john bye".
|
|
|
|
|
Based on Imran's solution, here is a bit more customized version which does as desired.
#include <iostream>
using namespace std;<DIV>
class CFirst
{
public:
CFirst() { cout << "Hi "; }
}<DIV>
class CLast
{
public:
CLast() { cout << " Bye"; }
}<DIV>
CFirst object1;<DIV>
int main( int argc, char* argv[] )
{
cout << "John" << endl;
return 0;
}<DIV>
CLast object2; This piece would print "Hi John\n Bye". Removing the line change from inside main is impossible, as far as I know, without doing some serious stream interception. All this seems unnecessary though. Just boot the line change from there, or pretend that you didn't notice it :P
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Actually this will/may put :
"Hi ByeJohn"
because both objects are initialized (constructors called) before main().
I say may, because as far as i know you can't count on the order that global objects will be initialized within a given init_seg.
Having said that you could use the
#pragma init_seg()
directives to put CFirst, CLast and main in different .cpp files and use init_seg(lib) for CFirst and init_seg(user) for CLast to ensure the order they were constructed ... but that seems like a whole lot of work to still get the wrong output.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Please refer the code i wrote above:
In the constructor of CTest class, there is an exit(0) call. So this program will never enter the main function.
Trick is that, in C++, global objects are created before program enters the main function. So we created the object of CTest class as a global object. As such its constructor gets called in which we first print our desired string and then exit(0) gets calls and the program ends.
|
|
|
|
|
What about as Imran had but :
CTest()
{
cout << "Hello ";
}
~CTest()
{
cout << " Bye";
}
... although you should really do your own homework.
[edit]
Hmmm, this doesn't print the " Bye", altough the code goes there. Even adding cout.flush() doesn't print it. Looks like ostream system has been shut down by then. Using printf() does work in printing " Bye", but you need to eat the \n first, and adding \b doesn't seem to work ... hmmm
[/edit]
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Couldn't remember the console cursor movement functions (ala curses).
However, here is a hack that works (and is within the contraints given ), but not likely the solution you need :
#include <iostream>
using namespace std;
class CFirst{
public:
CFirst() {
cout << "Hi ";
}
~CFirst() {
printf("Bye\n");
}
};
CFirst f;
#define endl ' '
int main( int argc, char* argv[] )
{
cout << "John" << endl;
return 0;
}
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hello all,
please don't laugh
but here is one solution
#include <iostream.h>
#define cout cout << "Hello "
#define endl " Bye" << endl
int main(int argc, char* argv[])
{
cout << "John" << endl;
return 1;
}
When all else fails read the manual
|
|
|
|
|
Not laughing, as valid a solution as any, given the constraints.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
That's the kind of solution that pisses teachers off. I love it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hi,
this solution should result in compilation error, although i haven't checked it but we can't apply #define on the cout and endl like this.
|
|
|
|
|
It isn't doable, because you #define cout as a part of itself.. Like, what you're doing is:
#define MAX_AMOUNT MAX_AMOUNT + 20 Similar type of error.
Man I really wish that that thing would've worked, it would've been a kickass "spoil-a-teacher's-day" for some C++-course
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|