How to read a .shd file in C++? - c++

I am creating a project in c++ for getting JobSettings of a job in a queue from .shd file.Can anyone please suggest me which API is used for reading .shd file?

If you're talking about the shadow file from the Windows spooler, take a look at this site and code accordingly - http://www.undocprint.org/formats/winspool/shd
Please note that this format is undocumented and so could change ever so often.

Related

How to track the number of times my console application in C++14 has been launched?

I'm building a barebones Notepad-styled project (console-based, does not have a GUI as of now) and I'd like to track, display (and later use it in some ways) the number of times the console application has been launched. I don't know if this helps, but I'm building my console application on Windows 10, but I'd like it to run on Windows 7+ as well as on Linux distros such as Ubuntu and the like.
I prefer not storing the details in a file and then subsequently reading from it to maintain count. Please suggest a way or any other resource that details how to do this.
I'd put a strikethrough on my quote above, but SO doesn't have it apparently.
Note that this is my first time building such a project so I may not be familiar with advanced stuff... So, when you're answering please try to explain as is required for a not-so-experienced software developer.
Thanks & Have a great one!
Edit: It seems that the general advice is to use text files to protect portability and to account for the fact that if down-the-line, I need to store some extra info, the text file will come in super handy. In light of this, I'll focus my efforts on the text file.
Thanks to all for keeping my efforts from de-railing!
I prefer not storing the details in a file
In the comments, you wrote that the reason is security and you consider using a file as "over-kill" in this case.
Security can be solved easily - just encrypt the file. You can use a library like this to get it done.
In addition, since you are writing and reading to/from the file only once each time the application is opened/closed, and the file should take only small number of bytes to store such data, I think it's the right, portable solution.
If you still don't want to use a file, you can use windows registry to store the data, but this solution is not portable

Auto download file from FTP and check against existing file

I have an internal company need to create some sort of application which does the following daily at a specific time:
connects to our company's internal ftp url (not a secure url)
downloads a file with a specific file name
checks the newly downloaded file with the file downloaded the day before
throws an error if the file is the same or else displays a message saying all is good (or sends an email or something with that notification)
That's it. All i need to do is to check and make sure the file on the ftp is different from the day before.
Can anyone recommend an easy way of doing this? I've tried googling for a solution and not quite finding a straight answer.
I've been out of programming for the last 8 years but I still remember visual basic 6.0 and visual c++.
Please guide / suggest as you see fit.
Thank you :)
For vc++:
You could use any ftp client library for downloading a file. Take a look at this SO question which could be useful to you C++ FTP Library? . Then you need a proper way to chech the time. I think your program might need to run at statup and check for the system time at a specific interval if the time is due then download the file. For this you can take alook at this question How to get current time and date in C++? . Finally there are numerous ways for comparing the file and outputing the result, for starters is suggest you use the std.

Beginner - data storage through XML or text files

I am a beginner in visual studio and has only code C and C++ in command line settings.
Currently, I am taking a module(software development) which requires me to come up with an expense tracker - a program which helps user tracks his/her daily expenses. Therefore, at the end of each individual day, or after a user uses finishes the program, we would have to perform data storage to store all the info in one place which we would export it during the next usage.
My constraint include not using any relational database(although i have no idea what it is :( ). Data storage must be done using XML or text files. Following this, I have several questions regarding data storage:
1) If data is stored successfully, do we export it everytime we start the program? And everytime after the user closes the program, we overwrite the existing data file and then store it accordingly?
2) I have heard from some people that using text file may be easier. Searching on the internet and library only provides me with information regarding XML and not text. Would anyone be able to help me with it? Like tutorials link and stuff?
Thank you very much!
File writing/handling works similar to every other buffer in c++.
you can enable file handling using the fstream header. You can create a file, write to it and over-write every time the program is run, or can even create a file the first time the program is run and then append to it every subsequent time the program runs.
Ive only ever done text files, never tried XML, but Im guessing they're similar.
http://www.cplusplus.com/doc/tutorial/files/ should give you everything you need to know.
Your choice of XML vs plain text depends on the kind of data that you'll be storing.
The reason why you'll only find XML libraries on the internet is because XML is a lot more complicated than plain text. If you don't know what XML is or if the data that you're storing isn't very complex, then I would suggest going with plain text.
For example, to track expenses, you might store a file like this:
sandwich 5.00
coffee 2.30
soft drink 1.50
...
It's very easy to read/write lines like this to/from a file in C++.

GML and JPEG2000 library

have you ever worked with JPEG2000 and/or GML?.
I'm reading documentation about GMLJP2 but I don't find any libraries that implement this. I mean, as far as I know it should be possible to have a GML file within a jp2 file (that is, a single file with both of the thigs).
Also, it's difficult to get a viewer that integrates GML and JPEG2000.
Any information regarding how to work with GML or JPEG200 is wellcome ;-)
Many thanks!
PD: I want to work with C or C++ but it doesn't matter the language yet
"Also, it's difficult to get a viewer that integrates GML and JPEG2000."
As I understand GML is just a block of metadata in XML inserted into JPEG2000 file. Any decent decoder should be able to extract it.
I wrote a JP2 metadata editor and included basic GML support.
You can download it here:
http://j2k-codec.com/mde.html
See the "gml.jp2" file for an example.
Hope it will be helpful.

File Signature Validation

I Have used a utility written by Mark Russinovich, it is used to validate the file signature.
Any one have ideas how this can be done, i know it is not a simple code, but just i need some hints, APIs, steps, A guide map, Just to go in the correct direction.
I read too much a bout the cryptAPIs, then I read too much about the certAPIs, but i cannot get any thing useful to simply link a given file with the (unknown to me) data stored in the windows.
if any can help me in this issue please help, thanks a lot.
You should read about Authenticode.