Hi Paul,
If I rem the line DyLibFree(pLib) in this function, located at the top of CStream.inc, it works with 64 bit and the -O switch. Why? I have no idea.
' ========================================================================================
' Opens or creates a file and retrieves a stream to read or write to that file.
' ========================================================================================
PRIVATE FUNCTION AfxSHCreateStreamOnFileEx (BYVAL pwszFile AS WSTRING PTR, BYVAL grfMode AS DWORD, _
BYVAL dwAttributes AS DWORD, BYVAL fCreate AS WINBOOL, BYVAL ppStream AS IStream PTR PTR) AS HRESULT
DIM AS ANY PTR pLib = DyLibLoad("shlwapi.dll")
IF pLib = NULL THEN EXIT FUNCTION
DIM pShCreateStreamOnFileEx AS FUNCTION (BYVAL pwszFile AS WSTRING PTR, BYVAL grfMode AS DWORD, BYVAL dwAttributes AS DWORD, _
BYVAL fCreate AS WINBOOL, BYVAL pstmTemplate AS IStream PTR, BYVAL ppStream AS IStream PTR PTR) AS HRESULT
pShCreateStreamOnFileEx = DyLibSymbol(pLib, "SHCreateStreamOnFileEx")
IF pShCreateStreamOnFileEx = NULL THEN EXIT FUNCTION
DIM hr AS HRESULT = pShCreateStreamOnFileEx(pwszFile, grfMode, dwAttributes, fCreate, NULL, ppStream)
' DyLibFree(pLib)
RETURN hr
END FUNCTION
' ========================================================================================