|
Mark Salsbery wrote: Taking a snapshot of the screen doesn't work - what if the
user drags another window across yours?
What you can do in fact (and what I do for my chart control) is that everything (axis, grid, and series) is first drawn on a memory bitmap and then the bitmap is blitted on the screen (this avoid also flickering). So, when I need to add a new point, I simply need to draw the new line.
Of course, everything needs to be redrawn when axis change for example.
|
|
|
|
|
Sure, that's a great method IMO I never know how much to give OPs in one shot LOL
Thanks!
Mark
Great job, team. Head back to base for debriefing and cocktails.
|
|
|
|
|
How to run an executable or an application in a particular computer.
Now i m checking with hardware profile id but seems not a unique id.
Is there any unique id to put in my code so that application runs in a computer that matches the ID?
|
|
|
|
|
Are you trying to say that the program is only authorized for certain computers. Is that the functionality you want?
------------------------
Impossible is Nothing
|
|
|
|
|
|
and what criterias must match for a computer to run the application ?
|
|
|
|
|
Lemme tell you the purpose.
Our application has to be mounted into clients system and it is sent through a CD, so there shouldn't be a provision for the client to install in a system which is not authorized.
What needs to be done for providing authorization?
It can be like MAC ADDRESS since it is unique, but if the client system doesn't have NIC then there's no concept of MAC ADDRESS. can you gimme any other solution for this?
|
|
|
|
|
i'd be tempted to use a hash map on the processor ID and some other hardware that you're sure are present...
the principle of the hash map is that on same entry data, it will generate always the same output.
|
|
|
|
|
hash map?? please be clear
|
|
|
|
|
i'm still confused. can you bring an example of what you're trying to do, and for my curiosity, tell why ?
|
|
|
|
|
I want to make my application authorized only for certain computers.
|
|
|
|
|
Super Hornet wrote: I want to make my application authorized only for certain computers.
i can read you 1st post ; you didn't provide much info there.
moreover, you don't answer all my questions
|
|
|
|
|
Super Hornet wrote: Is there any unique id to put in my code so that application runs in a computer that matches the ID?
No.
How could it, given that you can assemble the computer yourself from small silicon board?
What you experience is the problem of all copy protection schemes - and why they do not work.
Additional Hardware - called dongles - might provide the uniqueness you want.
There are several specialized companies.
Failure is not an option - it's built right in.
|
|
|
|
|
Do you want to protect your program with check hardware on other systems?
|
|
|
|
|
|
Its very difficult but see two discusses if they are helpfuls here[^] and here[^]
|
|
|
|
|
How about using the host name
char HostName[128];
gethostname(HostName, sizeof(HostName);
if(strcmp(Hostname,.....)
{
.......
Type "hostname" on the command line to get the comuter host name
|
|
|
|
|
host name is not unique. it can been changed.
|
|
|
|
|
One popular approach to this is to sell the software with a hardware key, like Alladin Knowledge Systems[^] sells. The key is a little USB device. You application looks to see if the key is present, and refuses to run if it is not found. The keys are programmable.
BTW: I only mention Alladin because I've used their stuff. There are other manufacturers of similar devices out there.
Software Zen: delete this;
|
|
|
|
|
i have to open ADDRESS.DAT i used in a previous assignment, i put the file in the same project folder as this assignment but i keep getting an error.
The assignment is to open the ADDRESS.DAT file and output it to the screen:
the error: c:\documents and settings\lutyk7\desktop\projects\project 8-3\project 8-3\project 8-3.cpp(75) : error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::basic_ostream<_Elem,_Traits>' (or there is no acceptable conversion)
the code:
#include "stdafx.h"<br />
#include <iostream><br />
#include <iomanip><br />
#include <fstream><br />
#include <string><br />
<br />
<br />
<br />
<br />
<br />
CWinApp theApp;<br />
<br />
using namespace std;<br />
<br />
<br />
<br />
int main()<br />
{<br />
string name, address, city, state, x; <br />
ofstream outfile;
ifstream infile;<br />
<br />
cout<<"Please enter your name: ";<br />
getline(cin, name);<br />
cout<<"Please enter your address: ";<br />
getline(cin, address);<br />
cout<<"Please enter with city: ";<br />
getline(cin, city);<br />
cout<<"Please enter your state: ";<br />
getline(cin, state);<br />
cout<<"Enter your zipcode: ";<br />
cin>>x;<br />
<br />
outfile.open("ADDRESS.DAT",ios::app);
<br />
if(outfile)<br />
{<br />
outfile<<name<<endl;<br />
outfile<<address<<endl;<br />
outfile<<city<<", "<<state<<" "<<x<<'\n'<<endl;<br />
outfile.close();
}<br />
else<br />
{<br />
cout <<"An error occurred while opening the file.\n";<br />
}<br />
<br />
infile.open("ADDRESS.DAT",ios::in);<br />
<br />
if (infile)<br />
{<br />
cout.setf(ios::fixed);<br />
cout << "The information your entered is as follows:\n"<br />
<< setprecision(1);<br />
<br />
cout << name >> endl;<br />
cout << address >> endl;<br />
cout << city >> ", " >> state >> " " >> x >> endl;<br />
cout << name << endl;<br />
cout << address << endl;<br />
cout << city << ", " << state << " " <<x<<endl;<br />
}<br />
else<br />
{<br />
cout << "An error occurred while opening the file.\n";<br />
}<br />
infile.close();<br />
return 0;<br />
}
|
|
|
|
|
klutez123 wrote: cout << name >> endl;
what the hell is this ???
with cout, use only <<
|
|
|
|
|
klutez123 wrote: C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::basic_ostream<_Elem,_Traits>' (or there is no acceptable conversion)
There's your problem, you're trying to get input from an output stream
|
|
|
|
|
Is it possible to disable usb drive(whichever) when its plugged?
There shouldn't be any access to USB Drive either write/read. All needs to be done through MFC.
suggestions are appreciated.
|
|
|
|
|
On Vista, there is a new group policy setting to disable USB drives.
|
|
|
|
|
You can disable/enable USB port by editing registry.
In order to disable USB port:
RootKey=HKEY_LOCAL_MACHINE
Key to open: "SYSTEM\\CurrentControlSet\\Services\\USBSTOR"
WriteInteger("Start",4)
Start is the name of REG_DWORD value, and 4 is the proper data for that value
In order to enable USB port:
RootKey=HKEY_LOCAL_MACHINE
Key to open: "SYSTEM\\CurrentControlSet\\Services\\USBSTOR"
WriteInteger("Start",3)
Start is the name of REG_DWORD value, and 3 is the proper data for that value
I've tried it with Windows 2000 and it worked
|
|
|
|