|
add a key in the register, so then, if the user uninstall the program, or if he changes the system time, you'll be able to detect if the version if out of date.
TOXCCT >>> GEII power
|
|
|
|
|
but how do you check for the date ..day by day....?
I am not getting how to validate it everyday?
incase user delete the registry ...what happens?
i am not getting the logic...for that.
vidya
|
|
|
|
|
You cannot stop all these attacks. Don't try, it is a waste of your time. Thieves WILL steal your application if they want to. Nothing you can do about it.
Make your focus on keeping the honest people honest. You want to remind them just often enough that this is an evaluation copy and they need to buy it, but not so often they are annoyed enough that they quit using the program instead of buying it.
If you print, make sure print outs have a header "This was printed by an evaluation version of FOO, please register it".
Even after your timeout expires, don't make the program expire completely, just make some functions less useful.
Last, what is your plan for users who install a program intending to check it out latter, and latter comes 6 months from then? Remember, your goal is to allow the honest users to make an honest evaluation before they buy your program. Theives won't buy your program no matter what you do to them.
|
|
|
|
|
Hi
For this to work you will have to write some amount of data in the permanent storage, say harddisk.
The algorithm goes like this
1. At the time of installing the application, Retrive the current date and time and number of days remainig (30), store it. (secretly)
2. Retrieve the current date and time, if it is equal to the stored value do nothing continue.
else
subtract both and get the value and change the stored date to this. Take the absolute value of the result. Substract this from the number of days remaining and make the result number of days remaining.
check if number of days is equal to zero...
if yes quit dont start the application.
Hope this would help you
Regards
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hi Everybody,
How to change the Background Color of view in SDIapplication. I tired CtlColor(), pDC->SetBkCOlor(). Nothing seems to work. Actually I want to convert my SDI application into to Console application and for this I want to change the Background color to Black and font color to White. Any Idea of how to do this.
Thanks in Advance.
bbye.
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
|
Thanks Sujan your sample worked. Great!!!.
bbye
|
|
|
|
|
Hy,
You mas't handle WM_ERASEBKGND window message fill client area whith black color,
then override OnPaint function on you CView delivered class.
|
|
|
|
|
well the easiest way to do this is to set the brush to the color you want in the PrecreateWindow message..... change the brush and the color changes to whatever brush you use.
for your particular use... just add this line in your view's PrecreateWindow message..
cs.lpszClass = AfxRegisterWndClass(CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW,AfxGetApp()->LoadCursor(IDC_ARROW),CreateSolidBrush(RGB(0,0,0)));
this will do it... change the parameters of the RGB macro in CreateSolidBrush to whatever color u want.
hope this will help.
nutkase....
|
|
|
|
|
CFDlink.exe->This is the name of the exe.
1)When I double click the CFDlink.exe in Windows 2000.The CFDlink GUI is opens and I clicked the
File->Open the application is not hanged.
2) But when I rename the CFDlink.exe to CFDlink_org.exe.And I double click the CFDlink_org.exe in Windows 2000.The CFDlink GUI opens & then I click the File->Open, then the CFDlink_org GUI hanged.
3)I not faced any such problem in Windows XP.Please let me know why such problem is occurs only in Windows 2000?
|
|
|
|
|
Hiya people,im looking for some help im in the middle of coding a window manager in vc++ this has been going okay,but i realised i could well be doing this the hard way,okay i made two listbox's one listbox stored all the title's of the descktop windows so that you can select basicaly select a window by its title and destroy or minimize it whatever the case maybe,the second list box was invisible and disabled and this was holding the handles to the windows that i recived with the EnumWindowsProc callback func,my intention was that it looked tidier not being able to see the text version of the handle to the window, so when i selected the title of the window from the first listbox that i wanted to perform an operation on,it would automaticaly match the title to the parent window's handle in the second listbox so that i could grab it and pass it too another api func.
i was wondering if i can use an array to store the handles to the windows but i would somehow need to be able to make reference to them from the title of the parent window i would like to close,
so to clear things up im a bit unsure about..
do arrays have to be static and store data that dosent change?
and what if you dont know the agsact size of an array?
does all this have to be predefined.
well thanks for your help i hope i painted a half decent picture,i just dont want to do this the wrong way! thanks
|
|
|
|
|
I think you should look into EnumChildWindows and EnumWindows. (look on MSDN or here on CP)
Keeping handles for a long time is not smart. If you keep handles, try to keep them very locally.
Hope this helps.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hello,
You can use a std::map<std::string, HANDLE> as an associative array to store the window handles...
Listboxes have a way of storing a 32 bit value with the item you inserted. MFC's CListBox provides SetItemData() for this purpose...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Thankyou for your comments ill look into your advice!
|
|
|
|
|
I have a dialog that I have an edit box on. The dialog is named: IDD_OPENGLDIALOG_DIALOG and the edit control is named IDC_EDIT1. I am getting 'constant' error when I try to run the following code. I have tried many variations and I still get this error. Please help!
CString holder1,holder2,holder3,holder4,holder5,holder6,holder7;
holder1 += IDD_OPENGLDIALOG_DIALOG.IDC_EDIT1;
Thanks,
Chris
|
|
|
|
|
IDD_OPENGLDIALOG_DIALOG is not an object but an integer. if you watch in your ressource.h, you'll see such lines :
<font color=#0000FF>#define</font> IDD_OPENGLDIALOG_DIALOG <font color=#000080>101</font>
so, you cannot apply the operator . to it.
instead, do this :
CString strEditText;
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
pEdit->GetWindowText(strEditText);
i advise you also to rename you edit (IDC_EDIT1 ) into a more conveniant name...
TOXCCT >>> GEII power
|
|
|
|
|
I have a BS_PUSHBUTTON inside of a BS_GROUPBOX. When I click on the pushbutton, wndProc doesn't seem to get the message about the pushbutton being clicked.
Any help on getting the button click message to WndProc would be greatly appreciated.
|
|
|
|
|
Hi,
I have never used CArchive but a friend said it was easy to do. After a flustrating Sunday, I must defer to you.
I have a CStringArray named: CStringArray m_sAstr;
and I wish to store the total content into a binary carchive.
Foo::LoadSave()
{
int nSize;
// Create archive ...
bool bReading = TRUE; // ... for writing
CArchive* ar = NULL;
CFile* pFile = new CFile();
ASSERT (pFile != NULL);
if (!pFile->Open ("foo.txt", CFile::modeReadWrite | CFile::shareExclusive)){
return;
}
try
{
pFile->SeekToBegin();
UINT uMode = (bReading ? CArchive::load : CArchive::store);
ar = new CArchive (pFile, uMode);
ASSERT (ar != NULL);
}
catch (CException* pException)
{
return;
}
if(ar->IsStoring())
{
nSize = m_sAstr.GetSize();
for(int i = 0;i<=nSize;i++){
ar->Write(m_sAsrt[i]);
}else if(ar->IsLoading())
{
}
Please I am not sure what I am doing wrong. A small sample please.
}
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|
|
BaldwinMartin wrote:
for(int i = 0;i<=nSize;i++){
you are doing an overflow guy !
prefer this :
<font color=#0000FF>for</font> (<font color=#0000FF>int</font> i = 0; i <font color=#FF0000><</font> nSize; i++) {
TOXCCT >>> GEII power
|
|
|
|
|
Hi
And thnk you,
I understand what you said is true, but my question was refering to CArchive.
Is there an known issue in the storing of asym. data?
Is there a problem with using a CList or CArray?
I do thank you, and hope that you can help with these issues.
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|
|
|
First add two new unicode configurations (for debug and release) to the project (Build->Configurations->Add). Next add the following definition /D "_UNICODE" in preprocessor definitions of your unicode projects (Project->Settings->Preprocessor definitions).
Regards,
Andrzej Markowski
|
|
|
|
|
|
Hi all,
I am reading a file which contains 128 byte header and then the actual pixel data. The bit depth is 12bits with the data type given as LSB_MSB (i think it means the first 8 bits of first byte contains LSB's and the next 8 bits contains reamaining 4 MSB bits... am i right?). Means this image file data is 12 bit dpeth with a range of (4096) greylevels. Now I am trying to convert this into 24 bit BMP file means 8 bits per R,G,B layer, since this is a greylevel image we will have same R,G,B value which leaves us with 256 grey levels instead of 4096. Now how can i do this conversion... or should i have to ignore the 4 MSB bits and consider only 8 LSB bits and create an RGB image form it....please help me out.. its very urgent....
Plz atleast any suggestions or ideas are appreciated... I have posted already abt this many times(from 1 month)...but i dont know whether I am not clear to u all... since as this is a site full of experts, i think atleast one may know this...
thanks in advance,
Suman
|
|
|
|
|
Hy,
Suman Niranjan wrote:
... or should i have to ignore the 4 MSB bits and consider only 8 LSB bits and create an RGB image form it....
No, if you ignore higest 4 bits, you lost data.
Conversion algoritm for this is :
<br />
#define MAX_SRC = 4096<br />
#define MAX_DEST = 256<br />
<br />
unsigned int src = GetNextSrcValue();<br />
float nvalue = (float)src/MAX_SRC;<br />
unsigned int dest = (int)(nvalue*MAX_DEST);<br />
<br />
|
|
|
|