|
hello people
my question is how do i make my software secure that is i have this application which i want the users to use for it a limited after which they must have a license how i do write code so that the application expires in a particualar time i heard that softwares that expire with time write something on the registry so dont you think anyone can just open up the registry and edit the setting and make the software work forever so how to make it secure any methods anyhing would be appreciated and also after the user has acquired a license where do i keep the license information and all please help
regards
Ahmed Ajmal
|
|
|
|
|
lol.... no comma, no full stop, complete chaos!
Don't try it, just do it!
|
|
|
|
|
Check out this link http://www.codeproject.com/system/cexpire01.asp?target=cexpire[^].
If you want to store data in the registry, encrypt it, and put in a location that is not obvious.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Cyberizen wrote:
anyone can just open up the registry and edit the setting
Not anyone, very few people actually understand how to work with registry.
Very, very, very few people are capable of hacking into binary encrypted data (assuming that you wright binary encrypted data into the registry). From my experience there is no such thing as absolutely secure system, however RC2 and other encryption algorithms are pretty close.
|
|
|
|
|
Hi all, I have a dilemma involving message handling. Basically I'm writing a game and have created a frontend in its own thread. To avoid multithreaded render problems the application always calls the frontend when it is required to be rendered. However, I would like the frontend to track all the keyboard and mouse messages (not the app) when the frontend is active, but the app should process them when it is inactive (to move the character etc.). I have not yet implemented directinput (though I am using directx), though maybe it is about time I did. What I would like to know is how to have my frontend feeding on mouse and keyboard messages sent to the app when its active, and stop when its inactive. I had a look at SetWindowsHookEx but this only gets activated when the app uses PeekMessage and the whole purpose of having my frontend in another thread spying on mouse and keyboard messages was so that lengthy renders don't inhibit the mouse and keyboard events. Any ideas or advice would be appreciated in this respect.
Many Thanks,
Alan.
|
|
|
|
|
Use the keyboard and mouse hooks instead.
John
|
|
|
|
|
You mean MouseProc (and KeyboardProc presumably)? Looking at this in MSDN it still waits for the app to peekmessage with a relevant message pending. I seem to be in a catch 22 where I want the frontend to handle message pumping when it is active and the app to handle it when it is not, I think a way of re-routing messages to a thread is perhaps what I need (so when the frontend is activated the messages are routed to that thread and when it is deactivated it is re-routed to the app thread). Not sure how to do this, or if its even worth it? What do ya reckon?
Thanks for the info though
Alan.
|
|
|
|
|
You mean MouseProc (and KeyboardProc presumably)? Looking at this in MSDN it still waits for the app to peekmessage with a relevant message pending. I seem to be in a catch 22 where I want the frontend to handle message pumping when it is active and the app to handle it when it is not, I think a way of re-routing messages to a thread is perhaps what I need (so when the frontend is activated the messages are routed to that thread and when it is deactivated it is re-routed to the app thread). Not sure how to do this, or if its even worth it? What do ya reckon?
Thanks for the info though
Alan.
|
|
|
|
|
read about the SetWindowsHookEx API in MSDN, and dont repeat urself
Don't try it, just do it!
|
|
|
|
|
Dangleberry wrote:
You mean MouseProc (and KeyboardProc presumably)? Looking at this in MSDN it still waits for the app to peekmessage with a relevant message pending.
Yes. This is what I mean. I am not sure that it does this however I have never used it in an app than did not have the default message pump...
John
|
|
|
|
|
i used the global keyboard hook for a winamp plugin
Don't try it, just do it!
|
|
|
|
|
Cheers for your responses, I've read the MSDN SetWindowsHookEx article which hooks the thread/process to the peekmessage pump. However, it seems to be event driven so when the peekmessage function is called from the app, the hook gets activated and the thread can handle the message if it wants. I think what I need is a message pump in its own thread that diverts messages to the appropriate thread depending on the application status, I think this solution will be a bit neater than stealing an apps messages. What do you reckon?
Alan.
And don't repeat yourself
Gareth Gates is on tv too much
|
|
|
|
|
Hi,
Any way to know what is the display area ?
I want one of the windows in my App to always consume around 3/4 of the display area.
Any ideas ?
Shay
|
|
|
|
|
nDimension = GetSystemMetrics (SM_CXFULLSCREEN / SM_CYFULLSCREEN / SM_CXSCREEN / SM_CYSCREEN);
Iain.
|
|
|
|
|
|
Hi Shay,
1) if you meening with display area your main-window call GetWindowRect() to get the size of your main-window.
2) if your display area the screen then call GetDeviceCaps(...) with HORZRES or VERTRES to get the size in Pixel (x and y) for your screen.
Then calc the size of your 3/4 Window and set the new size for it with SetWindowPos(...).
Regards
Frank
|
|
|
|
|
Hi,
How do i retrieve data from a list box inserted by a (ActiveX control i.e., the one which is inserted by clicking "insert active x control & then List Box DTC"..It seems there is a different way to do for ActiveX controls..can any one provide me with example codes..
Thanks,
Deepak Samuel
|
|
|
|
|
Judging from the C++ generated wrapper class for this control, it probably isn't very easy to do or recommended.
Is their a particular reason you want to use this control in a C++ project.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
I'm trying to define a char array;
char m_pData[256][4];
I don't get any error messages, but the program stops and gives me
a unhandled exeption when i run it.
this doens't work eiterh:
char *m_pData[256][4];
or
char m_pData[10][2];
but if I write char m_pData[2][2];
this works, it's probably just some properties needed to be change?
can anyone find a solution to this?
thanx
|
|
|
|
|
lol, a similar problem was posted here some days ago...
define char m_pData[256][4]; GLOBAL!
this should solve the problem
Don't try it, just do it!
|
|
|
|
|
I think the only reason why that solved your problem is that if you step past the end of a global variable you are probably not going to interfere with the runtime stack. Your problem probably still exists but in a sneaky way. Try the following declare your values array as
double ValuesArray[190];
Guess what it probably will not crash your dialog this time either. Why does it not crash the dialog? It is overwriting other variables in your global data that could come back and cause your program to work in an unexpected way.
John
|
|
|
|
|
I just tested my theory and it worked. I created a dialog application and in my OnOk() function I did the following which caused a crash because I am stepping past the end of ValuesArray.
void CStackOverflowDlg::OnOK()
{
double ValuesArray[200];
for(int i=0;i < 300;i++) {
ValuesArray[i] = 100.0;
}
}
Guess what moving ValuesArray to the global namespace and there was no crash at all.
double ValuesArray[200];
void CStackOverflowDlg::OnOK()
{
for(int i=0;i < 300;i++) {
ValuesArray[i] = 100.0;
}
}
But have I fixed the problem? Absolutely NO! I still am using more items ValuesArray than I declared...
John
|
|
|
|
|
The array is define global and public in the header file.
I have not yet been able to use the array, because when I
define it the application stops before I'm able to do anything.
a bit of the source code:
#pragma once<br />
<br />
#include "afxwin.h"<br />
<br />
#define MAX_DATARULES 256<br />
<br />
<br />
class CSpeechControlDlg : public CDialog<br />
{<br />
public:<br />
CSpeechControlDlg(CWnd* pParent = NULL); <br />
HWND m_hwndForeground;<br />
HWND m_oldfocus;<br />
<br />
char *m_pData[MAX_DATARULES][4]; <br />
<br />
....<br />
I need to use an array to fill it with information about speech commands
which the application recognizes.
It compiles, and links, but stops with an access violation exception!
When I created a new project this initialization worked perfectly,
this makes me very confused!
|
|
|
|
|
First, with this declatration: char *m_pData[MAX_DATARULES][4]; you just declare a two dimensional array that will contains .... POINTERS TO CHAR !!! I think you have to remove the * !!
Second, if you never use the array, the problem is not because of your array ! Are you sure you never try to write or try to read in it ??? If you try to access one 'cell', be carefull: in your case it's not a char but a pointer. And this pointer is NOT INITIALIZED so, it contins an invalid adress. That's probably why you have an error !
|
|
|
|
|
cedric moonen wrote:
I think you have to remove the * !!
I'm sure that you should remove the '*'
Besides that, you are not declaring a 2 dimensional array, but an array with 3 dimensions!!! If you want to use pointers, you have to initialize the array!
this should work:
char m_pData[MAX_DATARULES][4];
the pointer version
char *m_pData[4];
and initialize it this way:
for(int i = 0; i < MAX_DATARULES;i++) m_pData[i] = (char**) malloc(sizeof(char*));
:-OI haven't been doing such things lately so the initialisation could contain some errors
good luck!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|