|
Hi all,
I want to distribute my applications to others, but at the same time i want to make sure that it will run for the say N Days only. Can anyone give any direction to start. My application is Win32 Application and i am using MSVC 6.0
Thanks in advance.
AL
|
|
|
|
|
Producing something that can't be fooled by e.g. setting the machine date back to the day of the instalation is very hard.
Makeing a solution that is not diabled by harddisk imageing/restore is almost impossible.
But if thats OK for you, the best thing is to finde a hidden quiet spot in the registry, write some encrypted timestamp there and check at startup if you are more than N days later.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
In addition to jhwurmbach's suggestion, I would suggest making the registry key something not obvious. In other words, don't make it something InstallationDate, or DateOfExpire! Give it a name that has absolutely nothing to do with an expiring date.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi jhwurmbach abd David,
Thanks for suggestion.David can you elobrate future on how I can create the key which had nothing to do expiring date.
Again Thanks in advance
AL
|
|
|
|
|
Abhi Lahare wrote:
David can you elobrate future on how I can create the key which had nothing to do expiring date
Simple: As the name of the Key use a GUID (made by Guidgen.exe). In that keys value you can store the installation (or expiration) date. Probably as an integer, not a date-string.
Hope that helps
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I have read that a pointer has no relavence outside the process. What does this mean exactly. Can anyone explain this ..please. Also what about the far dont they refer to outside the process .... kindly explain.
Thank you.
|
|
|
|
|
You can use the analogy of a memory address being a phone number - where each process is equivalent to an area code.
If you call a number from the same area code you will get the person you expect. If you use a pointer withing your process you will get the data you expect...but if you use a phone number from a different area code you will get a wrong number and if you use a pointer from a different process you will get a wrong address which usually results in a program crash.
If you want to access another process' memory use the API call ReadProcessmemory which is equivalent (in the above tortured analogy) to adding the area code to the phone number.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Each process has its own virtual memory space. Simply, this means your processes pointer (0x1000) will
point to a different bit of silicon than the same pointer in a different process. This makes your
life simpler and allows for security (you have to work hard to damage another process, and vice versa).
The far keyword was used in 16bit windows to indicate a 32 bit pointer, with some other fancy bits.
It is completely obsolete in 32 bit machine. I imagine the compiler just pretends you hadn't typed
it.
Iain.
|
|
|
|
|
Iain Clarke wrote:
I imagine the compiler just pretends you hadn't typed
it.
Actually, the compiler never sees it as the preprocessor strips it out.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I was trying not to confuse the chap. I normally simplify preprocessor, compiler, and linker into
one big lump unless I can't do so. A big black box. Typed stuff in one end, exe / dlls out the other.
Unless they're doing occasional clever things, I imagine most people do to.
So there...
Iain.
|
|
|
|
|
I'm writing a context menu shell extension that is shown in response to user right-click on directory background. I need to get the explorer interface (iwebbrowser2 or similar) that executed my extension. From what I found the communication is one-way and I can't get what I need. Am I missing something, or is there some hack?
|
|
|
|
|
I've had a quick look see, and about the only information you get from the caller is the HMENU.
As this doesn't help you too much, you may be able to go from the mouse position. That would
certainly tell you the window of the explorer area. You may be able to go from there.
But in short, you're not *meant* to know / care. The information you need is passed through
the IShellExtInit::Initialize interface. That gives you the PIDL of the folder, and an
IDataObject (whatever that is!). I can't think why you'd need more.
If you expand of what you want from the caller, I may be able to help.
Iain.
|
|
|
|
|
Iain Clarke wrote:
If you expand of what you want from the caller, I may be able to help.
I want to be able change the directory of the calling explorer. More or less like the "Go To Folder" feature of http://www.shelltoysxp.com/[^].
|
|
|
|
|
Will a Separate copy of Dll be loaded for each application reference? If so, How can I share the same data between applications? could anyone explain please.
Shenthil
|
|
|
|
|
Correct. Each process gets a copy of the DLL data in its address space.
There are several solutions to data sharing across address space. One solution is memory-mapping.
Kuphryn
|
|
|
|
|
You can also mark certain data segments in a DLL as shared.
From the MSDN docs:
#pragma section ("mysectionname", read, write, shared)
__declspec(allocate("mysectionname")) int my_shared_variable = 0;
This will create a section within your DLL called mysectionname. It will be shared among the processes which loads the DLL. By using __declspec(allocate) you advise the compiler to put the variable in that section instead of it's private data segment.
--
You're entertaining at least.
|
|
|
|
|
Hello there,
I have a very stupid question to ask and I know I'm going to kick myself when I find the answer:
How do you change the font in a static text (label) box in a dialog.
Thanks in advance
|
|
|
|
|
Click the entire Dialog and Check for its properties. U'll have font attribute changing which changes the font of static text too.
Shenthil
|
|
|
|
|
But this changes the font of all the controls. I just want to increase the size of the static text control.
|
|
|
|
|
Create a CFont object to you liking settings... then
use setfont method of the static object to the font.
its really not that supid question
Programming is an art not a skill, every one can be a skilled programmer but not an artist.
|
|
|
|
|
Thanks for the reply, how do I access the objects SetFont() method?
CMyClass::SetFont( ) is wrong isn't it???
My dialog class is derived from CFormView class.
Thanks.
|
|
|
|
|
CWnd *pStatic = GetDlgItem (IDC_FONTINGSTATIC); // You need to give the label an actual ID.
... ERROR CHECK
pStatic->SetFont (...);
pStatic->Invalidate ();
Better?
|
|
|
|
|
TolTol wrote:
CMyClass::SetFont( ) is wrong isn't it???
My dialog class is derived from CFormView class.
SetFont is the member of CWnd not CFormView, but CFormView is derived from CWnd so you can use SetFont for CFormView also.
Programming is an art not a skill, every one can be a skilled programmer but not an artist.
|
|
|
|
|
|
I have a method OnBegindragUrlList() in my dialog class which implements the response to the LVN_BEGINDRAG message. I drag from a selected item in a control on my dialog onto Explorer. It maybe the desktop but it may also be an open folder. I want to know what folder my drag operation ends on so that I can then create a corresponding link. Nota that I do not want to copy or move a file and I don't want to create a link either as my file does not exist so I would get an error.
|
|
|
|