C++ Downloading File with Pause/Resume controls - c++

Is there a simple library that I can use to download files Asynchronously from the internet with pause/resume controls.

You didn't mention OS you use. In case of Linux/Unix you can use libcurl. This library is pretty simple in usage and powerful at the same time. It has curl_easy_pause method that does pausing and unpausing of current connection. Please see details at http://curl.haxx.se/libcurl/c/curl_easy_pause.html. Here you can find examples of working with libcurl.

For c++ you may see my library sample : main.cpp

Related

C++ ASIO driver setup

I ask you for help with the setup of ASIO sdk. I would like to use it to connect some external devices to my system but before that I am struggling to even join ASIO to my programme.
I've downloaded ASIO 2.3 from there:
http://www.steinberg.net/en/company/developers.html
and unfortunately C++ isn't my strongest point. SDK contains few folders (is folder named "Common" having every file needed?), there is no *.lib file only *.cpp and *.h files.
I don't know which files are necessary so the SDK is installed completely.
I was thinking about merging everything into one library but I don't know which files are important for SDK...
Can you give me any hints how can I add files to my program so I can start using ASIO functions in my code?
Sadly I haven't documented my ordeal last year. However, here's some pointers:
How to begin building a VSTi Plugin?
Setting up VST Steinberg SDK on Windows
Build a minimal VST3 host in C++
I admit that's basically cherry-picking the list of SO results for "steinberg", but at least the first 2 seem relevant.

Testing WinPCAP with a Console Application

I want to check if I could successfully load the dll's for WinPCAP and want to do it by writing a simple C/C++ console application. However I do not have neither experience nor an idea about how to do it. What I know is according to its def file:
LIBRARY Packet32
EXPORTS
PacketOpenAdapter
PacketSendPacket
PacketAllocatePacket
PacketInitPacket
PacketFreePacket
PacketResetAdapter
PacketReceivePacket
PacketCloseAdapter
PacketSetHwFilter
PacketGetAdapterNames
PacketRequest
PacketSetBuff
PacketSetBpf
PacketGetNetType
PacketSetReadTimeout
PacketSetNumWrites
PacketGetNetInfo
PacketSetMinToCopy
PacketSetMaxLookahead
PacketCancelPacket
PacketLoadDriver
PacketUnloadDriver
I must be checking these things. But how? Could you please help me?
Best Regards
Those are functions in the packet32 library, not in the WinPcap library. Packet32 is a library of routines that provide access to the lower-level packet capture mechanism that WinPcap uses, in a fashion that hides from WinPcap the differences between "Windows OT" (95, 98, Me) and Windows NT (modern versions of Windows, up to and including Windows 8); it's not intended to be used by users. See the page about packet32 in the WinPcap documentation.
You don't need a console application that checks any of the packet32 routines. What you need is a console application that checks the WinPcap routines; if packet32 isn't working, those routines won't work, either. So you should look at some of the sample programs on the Internet for libpcap/WinPcap.

How to implement QuickFix with my c++ project

I'm new to the Fix protocol and I've been trying to find a way to implement it into c++ files starting from a XML description file. So by searching on the net they recommended me with Quickfix, what I really want to know is what do we should call QuickFix? A library or a standard or what exactly?
But my main problem is that lately I downloaded the Quickfix package then I couldn't integrate it into my c++ project even with the QuickFix documentation ( which was vague by the way !) so can someone please describe to me exactly step by step how to configure QuickFix with My Visual c++ project and how can I eventually write this code to parse my XML file:
#include "Application.h"
#include "quickfix/Session.h"
Quickfix doesn't understand XML or parses XML, except for the message bank config file which is in XML. It only deals in FIX formatted strings. You have to use a XML parser i.e. xerces, libxml++ to extract your data in the XML file and then construct a FIX message using the Quickfix library and send wherever you want to.
Fiximate is a more user friendly place to check your FIX messages for correctness. There are examples in the Quickfix library to test an application, and you would need a config file to run it, examples are provided on the Quickfix website.
FIX is a standard: fixprotocol.org/specifications
QuickFIX is a FIX engine (c.f. Library) implementing the standard.
In the source files that you downloaded there is a set of examples which you can use to understand the operation of the engine. You should use these along side the documentation.
QuickFix is a library. There are other FIX engines also available.
It simplifies the implementation by taking care of many low-level things. All a developer has to do is enhance the APIs for messages.
There are good examples for a quick start and good documentation for a beginner.
To get into more details of QuickFix, code itself is well organized.

How do I use the 7z sdk to extract rar/zip files (C++)?

I'm trying to write a small, cross-platform comic book reader (Qt / C++). I don't care what's already out there, I know there are some.
My problem is that I need to read the comic book formats, which are renamed rar and zip files.
The documentation is very... nonexistent? There's no "hello archive" document anywho.
How can I set this up?
If It makes it easier to assume I'm on any particular OS, do so. I'm switching between Kubuntu, OSX, and Win7 constantly for dev work.
I've been working on a simple C++ wrapper for the 7zip SDK, which you can find here. It currently only supports Windows and the specific needs I had, but I'd be happy to make some alterations and/or accept contributions. It can extract 7zip and Zip files in a few lines of code, using the 7z.dll. RAR shouldn't be difficult to add since the DLL supports it.
7z should actually come with both source for a commandline variant and a GUI variant, you could dig into to those and see how they do the compression, else you could use unRar and see if that has any examples(unfortunatly I can't check due to the download being blocked where I am).
Poking around the LMZA SDK a bit I came across this:
ANSI-C LZMA Decoder
~~~~~~~~~~~~~~~~~~~
Please note that interfaces for ANSI-C
code were changed in LZMA SDK 4.58. If
you want to use old interfaces you can
download previous version of LZMA SDK
from sourceforge.net site.
To use ANSI-C LZMA Decoder you need
the following files:
1) LzmaDec.h + LzmaDec.c + Types.h
LzmaUtil/LzmaUtil.c is example
application that uses these files.

What API/SDK to use for this Windows Application?

I'm going to create a utility with GUI that will run on Windows operating systems.
It should require minimum (or zero!) amount of additional libraries, files or DLLs to run because it will be executed from an installer. Because of this, i don't want to use .NET for it will require user to install .NET Framework. I know today, most of Windows installed system come with .NET Framework but in my case i cannot be sure.
The utility will...
send some data to a web site and
parse the returning data,
collect some hardware info, like MAC address,
CPU type and make, hard-disk serial
number
I suppose native Win32 API could be used for all of those above, but instead of hassling with Win32, i'd prefer using a more developer friendly API, or SDK.
Thanks in advance.
Win32 API is the only way, and of course there are standard API - for sending data over the internet, you could use WinInet.lib/dll, to obtain information about the MAC, you could use the GetAdaptersInfo by using Iphlpapi.lib/dll,(here's a link on how to use it) for the Hard disk serial number you could use GetVolumeInformation by using kernel32.lib/dll. For the CPU Id, you might look into GetSystemInfomation
Edit: There's a C++ code, but you can easily derive a wrapper from this site Unfortunately, with WinAPI is not easy, no such thing as RAD with WinAPI but what you gain out of it is lightweight code instead of relying on SDK's, frameworks and dragging buggy dll's around with your application.
Hope this helps,
Best regards,
Tom.
You can statically link most C++ GUI libraries - even MFC. Personally, I recommend WTL, wihich is very light and header-only.
If what you want is minimum dependency with external files or DLLs you could statically compile all the required DLLs with the tool exe. Then you could use something like Visual C++ to develop such tool.
WTL is perfect for this sort of application and I am surprised more people aren't recommending it. You can also statically link with the CRT and hey presto - no dependencies and a very small EXE.
Delphi (now by Embarcadero) would do the job, creating a .exe file with no dependencies, and it is much easier to work with than the raw Win32 API.
If you don't like Object Pascal, you could try C++ Builder instead.
For the GUI you can either build your application with MFC (statically linked) or use a HTML based dialog that you can interact with using COM. (It is even possible to interact with javascript present in the page displayed by the dialog).
For the specific requirement that you do have, I feel Win32 API is the only way out.
Use MFC and statically link to it. No runtime dependancies need to be installed.