                    

#ifndef UTILS_H
#define UTILS_H






void SplitBSTR(BSTR Line, BSTR* *pawWords, int *pCount);
// splitts a BSTR into words separated by white spaces and stores the words in a newly allocated BSTR array.

void FreeBSTRs(BSTR* *pawWords, int *pCount);
// frees the array created by SplitBSTR.

// free BSTRS 
void FreeBSTRArray(BSTR* pawWords, int pCount);


BSTR StrToBSTR(const char* Str, int *pLen= NULL, int additionalSpace= 0);
// converts a const char* string into a BSTR string. 
// if pLen is not NULL, stores the length of the result there.
// allocates space for additionalSpace characters in the resulting buffer.


char* BSTRtoStr(BSTR wStr, int *pLen= NULL, int additionalSpace= 0);
// converts a BSTR string into a const char* string. 
// if pLen is not NULL, stores the length of the result there.
// allocates space for additionalSpace characters in the resulting buffer.
// Does not rely on wStr being allocated by SysAllocString(.) and friends.









#endif

