|
bulg wrote: "internet" programming is done using "sockets".
Yes, I know that. I was more interested in suggestions about which type of "server" would be best for me to create to handle the incoming traffic. I know I can open a socket and retrieve the data and write it to a buffer. Once I have the data, I guess I could then pass it to the USB device. Or write it to a file and have the USB device read it in.
|
|
|
|
|
Hrmm, then I'm going to try to guess that your question could be narrowed down a little bit more:
How does a server make and keep track of multiple clients and sessions ( aka, client logs in, interacts with the system, logs out)?
|
|
|
|
|
No, not that complex. Only 1 client (me) and one session (mine). I will call the customer, have them start the application that I write, and then connect to the application. Once connected I will send a couple of commands to my embedded device, wait for an answer, and disconnect.
I'm thinking something similar an automated telnet session except I will write it. I don't won't to depend on, or mess up, anything on the remote computer. Or maybe some type of RPC call. Just kicking ideas around in my head for now. The code won't be too difficult. I just need to decide how to do it.
|
|
|
|
|
Your two things (baby client / server) and (talk to my usb device) are really quite separate problems.
I embedded a simple 1 to 1 server in my main software for a PDA to communicate with over TCP/IP. I blatantly used CCESocket: a general purpose TCP/UDP socket class for WinCE[^] to great effect.
Where you will have to be careful is that is handles packets in a separate thread to the main UI. That's not an issue, you just have to keep your eyes open. And it's better than using the abominations that are the built in classes.
On to the USB part... You may already be doing it, but my article Detecting when drives are added or removed[^] could be of use. I initially wrote a version that detected USB chipsets from FTDI being added / removed.
Good luck,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Lain, thanks for pointing out the article. I will pursue that. I was going to use the built in classes and just put up with the overhead. This looks like a much better approach.
I am already detecting my USB device being plugged in. I am using the Microchip USB stack and developed my device using one of their tools. Once I can talk to it over the local LAN I think the rest of it will be easy.
Ray
|
|
|
|
|
I am working on a set class and I have successfully written an insert function, but I need the function to insert in an ordered fashion.
bool Set::insert( const EType & A )
{
bool Flag = false;
unsigned Position = 0;
Node * Prev = Head;
Node * Curr = Head->Succ;
Node * Temp;
Temp = new Node;
if (Temp != NULL )
{
Temp->Item = A;
Temp->Succ = Curr;
Prev->Succ = Temp;
Num++;
Flag = true;
}
return Flag;
}
Set::Set()
{
Num = 0;
Head = new (nothrow) Node;
Head->Succ = NULL;
}
class Set
{
private:
struct Node
{
EType Item;
Node * Succ;
};
unsigned Num;
Node * Head;
Tell me if anything else is needed
|
|
|
|
|
This smells of a linked list. See here for pseudo code.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Does anyone have an idea how I can detect if a file has been copied?
I'm trying to develop a simple (hopefully) protection scheme that'll allow me to distribute a license file to a customer, and our application will read the file to update their license.
What I don't want is for the client to be able to copy the license file and 'give' it to another of our customers and avoiding our licensing scheme.
Right now, our application reads the license file and then modifies it so that it's no good any more, so copying it after the fact wouldn't work...I'd like to prevent someone from copying the original un-altered file before it's used.
I've tried to use the GetFileTime() function to get the Creation, LastAccessed, and LastWrite times of the file, but these don't appear to change for a copy of the file.
Any suggestions/ideas?
Steve
|
|
|
|
|
What criteria is used to generate the license in the file (e.g., HDD serial number, MAC address of NIC, license/registration key of Windows)? When the file is copied from one machine to another, check that criteria, compare it to what is in the file. If they do not match, don't allow usage of your software.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
The license file is a simple text file (scrambled so it's not obvious what information is what).
What I want to do is to create the file on my computer and distribute it to customers (on a floppy/CD/Flash Drive). When they run our app (which is not copy protected), it will look for and read the new license file and extract the information from it. It then re-writes the file so it can't be used again.
We do not record any hardware specifics of the installation, so I can't 'key' the license file to a specific machine.
What I'd hoped to do was to record (in the file) the date of it's creation...then, when our app reads the file, it checks the date stamp on the file and if it didn't match, it wouldn't apply the license. Alas, when I make a copy of the license file, all the dates I can find (Creation, Last Accessed, and Last Written) appear to copy too.
Are there any attributes of a copied file that are different from the original that I can use to detect an unauthorized copy?
|
|
|
|
|
I have seen lots of protection schemes, all free ones are (almost) worthless.
The best solutions are:
1. no protection at all (no hassle for the user, no waste of time for the developer; yes you loose some customers who would not have paid for your product anyway);
2. hardware-dependent protection
2a. encode some characteristic (baseboard number, MAC address, disk number) in a license file; disadvantage: lots of hassle; customers don't like their software to stop functioning when they change some hardware, possibly for good reasons.
2b. idem, with server access instead of license file; disadvantage: same plus needs internet every time.
2c. deliver special hardware device (dongle). Costs ca 30$
2d. link to the serial number of a USB stick (best of all these). Still the hassle.
steve76063 wrote: Are there any attributes of a copied file that are different from the original that I can use to detect an unauthorized copy?
There is one: the physical sector number on disk. That is how some programs used to get protected on a floppy or CD. But then you could make binary copies of those disks (before first use).
And good luck if you want your app, run by a non-admin, find out its sector number on modern Windows versions (Vista, 7).
|
|
|
|
|
Well, I may have found what I've been looking for...
Keep in mind, I'm not looking for a foolproof copy protection scheme--there's no such thing. We've used dongles before, but it gets cumbersome--especially when the client's computer already has 4 or 5 other dongles already attached!
I was just looking for a quick simple way to prevent unauthorized copying of my file.
I've found out that when I CreateFile() I can use the FILE_ATTRIBUTE_OFFLINE for the file and it's file icon is a light blue X, and it's Attribute is listed as O. If I copy the file to another location, it loses it's 'O' attribute! I'm can test for the attribute using the GetFileInformationByHandle() and it works just fine.
I'm just trying to deter casual copiers, not dedicated 'crackers', so this should be 'good enough'.
One caveat that I've just discovered is that the Offline attribute is only for NTFS drives, so that leaves out distributing my file via Floppy or CD...it'll have to be an NTFS formatted Flash Drive.
modified on Monday, April 13, 2009 6:21 PM
|
|
|
|
|
|
Hi All
When file is deleted from drive then some where present in hard disk.i want to know where is present in hard disk.Can any one tell me where is present file in hard disk.There is any API or document.
plz help me
|
|
|
|
|
At the file system level, a file does not get moved when it is deleted. The file system simply marks its space as available.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks for reply
How can i get it from Hard disk?Can you give me API?
|
|
|
|
|
No API is available you have to do it to understand File System.
|
|
|
|
|
Here[^] you find some open source project related to File recovery.
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
I have written CDocument derived class's Serialize method to check the version on the archive and throw an exception if it doesn't match. After throwing the exception, the Window title still shows the file name that had an error.
How do I cancel serialization completely and go back to the previous file that was open?
Thank you masters!
|
|
|
|
|
I used the following method to cancel the serializing process:
void CMyAppDoc::Serilize(CArchive &ar)
{
if (
{
ar.abort();
return;
}
}
But it always cause an exception. Any idea?
Thank you masters!
|
|
|
|
|
Hi guz ..
in my project im reading input file from .txt
the file contains has two rows
first row contains A,B,C ans so on, in UPPER mode
second row contains a,b,c ,,, bla bal bla
for exmaple the user input A the program will out put a as well
how i can math this toghther ??
im using two for loops one to hold 1st row
and the other for loop to hold the 2nd row
i tried to output the output was same as format of .txt file
and my question how to input for example A the output will be a?
|
|
|
|
|
As of now, I know that you have a file and a program. If you can rephrase your query to something that we can understand, well, we will reply.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
dr.nokia wrote: in my project im reading input file from .txt
the file contains has two rows
first row contains A,B,C ans so on, in UPPER mode
Do you have something like:
std::ifstream fin;
fin.open("Letters.txt");
std::string strLine;
std::getline(fin, strLine);
std::replace(strLine.begin(), strLine.end(), ',', ' ');
std::stringstream ss(strLine);
std::vector<char> vecUpper;
std::copy(std::istream_iterator<char>(ss), std::istream_iterator<char>(), std::back_inserter(vecUpper));
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
Is it possible to call a visual studio 2008 dll from VS6.0 dll? I am using VC++.
If you guys have some information regarding this, please let me know.
regards,
Rana
|
|
|
|
|
Yes.
It shouldn't be a problem unless you are mixing Managed and Native terminologies.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|