titbits from the world less travelled

Archive for February, 2009

How to: Convert Between Char* to wchar*

To convert between a small char to a wide char, I would showing two types with a very little variation. You can use either to take away warnings between these conversion:

Method 1:
char *nexToken;
char *strMy = strtok_s( strM, %,&nextToken);
while (strMy != NULL)
{
wchar_t *lpfile;
lpfile = NULL;
mbstowcs(lpfile,strMy,100);
}
Method 2:
char *nexToken;
char *strMy = strtok( strM, %);
while (strMy != NULL)
{
wchar_t *lpfile;
lpfile = NULL;
mbstowcs(lpfile,strMy,100);
}
do not use secure tokenizer over here
Method 3 (referred to MSDN here):
char *strMy;
size_t origsize = strlen(strMy) + 1;
const size_t newsize = 100;
size_t convertedChars = 0;
wchar_t wcstring[newsize];
mbstowcs_s(&convertedChars, wcstring, origsize, strMy, _TRUNCATE);
//wcscat_s(wcstring, L (wchar_t *));
wcout << &&&<

These conversion are helpful when you try to call system builtin functions in VStudio
posted by admin in Uncategorized and have No Comments

Google AdWords in GMAIL

I really dont know what to write about here. Many of you out there must have seen this but given a thought to this. Ok..let me just put it in points..might be I can express myself more in this way:

posted by admin in Uncategorized and have No Comments

WGET: My fav download tool.

WGET: What is it. In simple words its a tool to download URLs. And its very good in that.

Incase you would like to download a URL just type in linux:
wget http://www.kmdarshan.com
Now try downloading all files inside a URL
wget -r -l1 –no-parent -A.vnd http://www.kmdarshan.com /
Let me explain this keep -A right there .vnd is the extension you would like to download. This might be gif, jpeg and so on. Ok..for your convenience *.jpeg wont work with wget.
posted by admin in Uncategorized and have No Comments

wbemuuid.lib: compilation errors vc6

wbemuuid.lib: compilation errors vc6

One of the errors we often see, when compiling vc6 and when you have included the library wbemuuid.lib, is the recompile module or corrupt error.

The best thing to do would be replace this lib in c:Program filesMicrosoft Platform SDKLib

This would work fine

posted by admin in windows and have No Comments