Replace CStr for CObject and fix type bug i previous commit.