I currently need a bunch of helper functions to work with BSTR types. Actually, once I got past the initial shock, they are kind of fun, and not bad to work with. Anyway, I've worked out enough functions now so I can do most of the tasks I'm expecting to need. The functions I have vary from well thought out tight code, to pure hacks just to get it done and working. Currently, I'm way too deep into the current project to stop and write a tut and release them, but anyone who wants may request an email copy. Here's a list of functions in the lib:

;-------------------------------------------------------------------------------
GetPrivateProfileBSTRING    PROTO :DWORD, :DWORD, :DWORD, :DWORD
;   useage prototype
;    invoke GetPrivateProfileBSTRING, bstrSection, bstrKeyName, 
;                                     ADDR bstrData, bstrFileName
; Description: follows same convention of GetPrivateProfileString, but uses
;     BSTR, alloc's the buffers, and defaults to NULL bstr for unfound entry
;-------------------------------------------------------------------------------
WritePrivateProfileBSTRING    PROTO :DWORD, :DWORD, :DWORD, :DWORD
;   useage prototype
;    invoke WritePrivateProfileBSTRING, bstrSection, bstrKeyName, 
;                                       bstrData, bstrFileName
;   follows same convention of WritePrivateProfileString, but uses BSTR.
;
;-------------------------------------------------------------------------------
bstrCat		PROTO :DWORD, :DWORD
; useage prototype:
;    invoke bstrCat, ADDR bstrReturn, bstrSource
; Description: concatenates bstrSource to the right of bstrReturn
;   and returns it in *bstrReturn
;-------------------------------------------------------------------------------
bstrInString PROTO :DWORD, :DWORD, :DWORD
;-------------------------------------------------------------------------------
; InString searches for a substring in a larger string and if it is
; found, it returns its position in eax. 
; It uses a one (1) based character index (1st character is 1,
; 2nd is 2 etc...) for both the "dwStartPos" parameter and the returned
; character position.
; Return Values.
; If the function succeeds, it returns the 1 based index of the start
; of the substring.
;  0 = no match found
;-------------------------------------------------------------------------------
bstrLeft	PROTO :DWORD,:DWORD,:DWORD
; useage prototype:
;    invoke bstrRight, bstrSource, dwCCount, ADDR bstrReturn
; Description: extracts the first dwCCount characters from bstrSource, 
;   and returns it in *bstrName
;-------------------------------------------------------------------------------
bstrRight 	PROTO :DWORD,:DWORD,:DWORD
; useage prototype:
;    invoke bstrRight, bstrSource, dwCCount, ADDR bstrReturn
; Description: extracts the last dwCCount characters from bstrSource, 
;   and returns it in *bstrName
;-------------------------------------------------------------------------------
bstrMid		PROTO :DWORD,:DWORD,:DWORD,:DWORD
; useage prototype:
;    invoke bstrMid, bstrSource, dwStart, dwCCount, ADDR bstrReturn
; Description: extracts dwCCount characters from bstrSource, 
;   starting at dwStart, and returns it in *bstrName
;-------------------------------------------------------------------------------
GetCLW 		PROTO :DWORD, :DWORD
; useage prototype:
;    invoke GetCLW, ArgCount, ADDR bstrReturn
; Description: parses the WIDE command line for parameters. 
; Returns bstr strings in *pItemBuffer
; 	arg 0 = program name
; 	arg 1 = 1st arg etc....
; Return values in eax:
; 	1 = successful operation				3 = non matching quot marks
; 	2 = no matching argument at arg number		4 = empty quotation marks
;-------------------------------------------------------------------------------
DW2BSTR		PROTO :DWORD, :DWORD
;   useage prototype
;    invoke DW2BSTR pbstrResult, dwData
;   Description: Converts a dword quantity to a unicode bstr string dwData
;    and returns it in *bstrResult
;-------------------------------------------------------
Posted on 2001-03-02 21:19:00 by Ernie
Sign me up :) EMAIL: jaymeson_online@hotmail.com Thanx. NaN
Posted on 2001-03-02 22:17:00 by NaN