Click here to Skip to main content
15,885,054 members
Articles / Desktop Programming / WTL

WTL Helper

Rate me:
Please Sign up or sign in to vote.
4.92/5 (116 votes)
27 Aug 200713 min read 700.7K   8.8K   190  
Add-in for Microsoft VC++.NET 2003 that helps to insert message handlers for WTL.
#pragma once

#include <comutil.h>

class CBSTRConvert
{
public:
	static _bstr_t ToString(char Value);
	static _bstr_t ToString(unsigned char Value);
	static _bstr_t ToString(short Value);
	static _bstr_t ToString(unsigned short Value);
	static _bstr_t ToString(int Value);
	static _bstr_t ToString(unsigned int Value);
	static _bstr_t ToString(long Value);
	static _bstr_t ToString(unsigned long Value);
	static _bstr_t ToString(__int64 Value);
	static _bstr_t ToString(unsigned __int64 Value);
	static _bstr_t ToString(float Value);
	static _bstr_t ToString(double Value);
	static _bstr_t ToString(bool Value);
	static _bstr_t ToString(const void* pData, size_t Len);
	static _bstr_t ToString(LPCTSTR Value);

	static bool FromString(const _bstr_t Str, char& Value);
	static bool FromString(const _bstr_t Str, unsigned char& Value);
	static bool FromString(const _bstr_t Str, short& Value);
	static bool FromString(const _bstr_t Str, unsigned short& Value);
	static bool FromString(const _bstr_t Str, int& Value);
	static bool FromString(const _bstr_t Str, unsigned int& Value);
	static bool FromString(const _bstr_t Str, long& Value);
	static bool FromString(const _bstr_t Str, unsigned long& Value);
	static bool FromString(const _bstr_t Str, __int64& Value);
	static bool FromString(const _bstr_t Str, unsigned __int64& Value);
	static bool FromString(const _bstr_t Str, float& Value);
	static bool FromString(const _bstr_t Str, double& Value);
	static bool FromString(const _bstr_t Str, bool& Value);
	static bool FromString(const _bstr_t Str, void* pData, size_t MaxLen);
#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__) || defined(__AFXSTR_H__)
	static bool FromString(const _bstr_t Str, CString& Value);
#endif
};

class _variant_ex : public _variant_t
{
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Belarus Belarus
I am a software developer for 3 years.

Comments and Discussions