Index: Include/com/variant.ab
===================================================================
--- Include/com/variant.ab	(revision 200)
+++ Include/com/variant.ab	(revision 208)
@@ -156,9 +156,19 @@
 		Variant.Move(Detach, v)
 	End Function
-
+/*
+	Static Function Assgin(ByRef from As VARIANT) As Variant
+		Assign = New Variant
+		Assgin.Assign(from)
+	End Function
+
+	Static Function Attach(ByRef from As VARIANT) As Variant
+		Attach = New Variant
+		Attach.Attach(from)
+	End Function
+*/
 	'Operators
 
 	Const Function Operator ^(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarPow(This.v, y.v, ret.v)
 		Return ret
@@ -170,5 +180,5 @@
 
 	Const Function Operator -() As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarNeg(This.v, ret.v)
 		Return ret
@@ -176,5 +186,5 @@
 
 	Const Function Operator *(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarMul(This.v, y.v, ret.v)
 		Return ret
@@ -182,5 +192,5 @@
 
 	Const Function Operator /(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarDiv(This.v, y.v, ret.v)
 		Return ret
@@ -188,5 +198,5 @@
 
 	Const Function Operator \(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarIDiv(This.v, y.v, ret.v)
 		Return ret
@@ -194,5 +204,5 @@
 
 	Const Function Operator Mod(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarMod(This.v, y.v, ret.v)
 		Return ret
@@ -200,5 +210,5 @@
 
 	Const Function Operator +(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarAdd(This.v, y.v, ret.v)
 		Return ret
@@ -206,5 +216,5 @@
 
 	Const Function Operator -(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarSub(This.v, y.v, ret.v)
 		Return ret
@@ -212,5 +222,5 @@
 
 	Const Function Operator &(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarCat(This.v, y.v, ret.v)
 		Return ret
@@ -218,5 +228,5 @@
 
 	Const Function Operator And(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarAnd(This.v, y.v, ret.v)
 		Return ret
@@ -224,5 +234,5 @@
 
 	Const Function Operator Or(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarOr(This.v, y.v, ret.v)
 		Return ret
@@ -230,5 +240,5 @@
 
 	Const Function Operator Xor(y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarXor(This.v, y.v, ret.v)
 		Return ret
@@ -236,5 +246,5 @@
 
 	Const Function Operator Not() As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarNot(This.v, ret.v)
 		Return ret
@@ -242,5 +252,5 @@
 
 	Static Function Imp(x As Variant, y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarImp(x.v, y.v, ret.v)
 		Return ret
@@ -248,5 +258,5 @@
 
 	Static Function Eqv(x As Variant, y As Variant) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarEqv(x.v, y.v, ret.v)
 		Return ret
@@ -254,5 +264,5 @@
 
 	Const Function Abs() As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarAbs(This.v, ret.v)
 		Return ret
@@ -260,5 +270,5 @@
 
 	Const Function Fix() As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarFix(This.v, ret.v)
 		Return ret
@@ -266,5 +276,5 @@
 
 	Const Function Int() As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarInt(This.v, ret.v)
 		Return ret
@@ -272,5 +282,5 @@
 
 	Const Function Round(cDecimals As Long) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		VarRound(This.v, cDecimals, ret)
 		Return ret
@@ -286,5 +296,5 @@
 
 	Static Function Compare(x As Variant, y As Variant) As HRESULT
-		Return VarCmp(x.v, y.v, GetUserDefaultLCID(), 0) 'VARCMP_NULL = 3を返す場合があるので注意
+		Return VarCmp(x.v, y.v, LOCALE_USER_DEFAULT, 0) 'VARCMP_NULL = 3を返す場合があるので注意
 	End Function
 
@@ -344,5 +354,5 @@
 
 	Const Function ChangeType(vt As VARTYPE, flags As Word) As Variant
-		Dim ret As Variant
+		Dim ret = New Variant
 		ChangeType(ret, flags, vt)
 		Return ret
@@ -368,6 +378,5 @@
 		Dim tmp = ChangeType(VT_BSTR)
 		Dim bs = ((tmp.v.val As ULONG_PTR) As BSTR)
-		Dim s As String(bs As PCWSTR, SysStringLen(bs) As Long)
-		Return s
+		Return New String(bs As PCWSTR, SysStringLen(bs) As Long)
 	End Function
 
@@ -520,5 +529,5 @@
 		Dim r As VARIANT
 		ChangeType(r, 0, VT_BSTR)
-		Dim bs As BString
+		Dim bs = New BString
 		bs.Attach(GetPointer(VarPtr(r.val)) As BSTR)
 		Return bs
@@ -528,4 +537,5 @@
 		Clear()
 		v.vt = VT_BSTR
+		SetPointer(VarPtr(v.val), x.Copy())
 	End Sub
 
@@ -588,5 +598,5 @@
 End Class
 
-Dim _System_VariantOptionalParam = Nothing As Variant
+'Dim _System_VariantOptionalParam = Nothing As Variant
 
 /*
