What is the meaning of Vainly?

In a vain pursuit; to no avail.

With a vain attitude; in a self-approving manner.

Source: wiktionary.org