about parameter
-
I have built a interface as below: HRESULT GetBSTR1([out,retval]BSTR* bstrInfo); If VBScript call this component method the codes as below: Set aaa = CreateObject("ATLTest.TestOne") v1=aaa.GetBSTR1() MsgBox v1 OK and if I build my interface into HRESULT GetBSTR2([out]BSTR* bufName1,[out,retval]BSTR* bufName2); how the VBScript call this method
-
I have built a interface as below: HRESULT GetBSTR1([out,retval]BSTR* bstrInfo); If VBScript call this component method the codes as below: Set aaa = CreateObject("ATLTest.TestOne") v1=aaa.GetBSTR1() MsgBox v1 OK and if I build my interface into HRESULT GetBSTR2([out]BSTR* bufName1,[out,retval]BSTR* bufName2); how the VBScript call this method
I Don't know about vbscript but in VB
Dim a As New TESTCOM1Lib.TestInterface
Dim str, str1 As String
str = a.GetBSTR2(str1)
MsgBox str1, vbOKOnly, str----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk
-
I Don't know about vbscript but in VB
Dim a As New TESTCOM1Lib.TestInterface
Dim str, str1 As String
str = a.GetBSTR2(str1)
MsgBox str1, vbOKOnly, str----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk
Sorry I haven't ever learned VB Private Sub Form_Load() Dim a As New ATLTESTLib.ITestTWO Dim str, str1 As String str = a.GetBSTR2(str1) MsgBox str1, vbOKOnly, str End Sub Compile Error and My COM Interface Is: interface ITestOne : IDispatch { [id(1), helpstring("method GetBSTR1")] HRESULT GetBSTR1([out,retval]BSTR* bstrInfo); [propget, id(2), helpstring("property property")] HRESULT property([out, retval] long *pVal); [propput, id(2), helpstring("property property")] HRESULT property([in] long newVal); }; [object,uuid(6FFD87E9-5733-4DF2-A33A-161D44FBC7D0),dual,helpstring("ITestTwo Interface"),pointer_default(unique)] interface ITestTwo : IUnknown { [id(1), helpstring("method GetBSTR2")] HRESULT GetBSTR2([out]BSTR* bufName1, [out,retval]BSTR* bufName2); }; [uuid(D8F2F3E6-3356-437B-849D-087CCD9439F0),version(1.0),helpstring("ATLTest 1.0 Type Library")] library ATLTESTLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); [ uuid(9072075F-656A-4B1C-9809-17A6164D1507), helpstring("TestOne Class") ] coclass TestOne { [default] interface ITestOne; }; };
-
I Don't know about vbscript but in VB
Dim a As New TESTCOM1Lib.TestInterface
Dim str, str1 As String
str = a.GetBSTR2(str1)
MsgBox str1, vbOKOnly, str----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk
-
Wait i will send you code for both application send me mail at alok@efextra.com ----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk
-
I have built a interface as below: HRESULT GetBSTR1([out,retval]BSTR* bstrInfo); If VBScript call this component method the codes as below: Set aaa = CreateObject("ATLTest.TestOne") v1=aaa.GetBSTR1() MsgBox v1 OK and if I build my interface into HRESULT GetBSTR2([out]BSTR* bufName1,[out,retval]BSTR* bufName2); how the VBScript call this method
If I recall correctly, VBScript can't handle out-only parameters. -- Weiter, weiter, ins verderben. Wir müssen leben bis wir sterben. I blog too now[^]
-
If I recall correctly, VBScript can't handle out-only parameters. -- Weiter, weiter, ins verderben. Wir müssen leben bis wir sterben. I blog too now[^]
-
It turns out that VBScript can do [out] parameters, but only if the type of the parameter is VARIANT, as this article[^] explains. -- Weiter, weiter, ins verderben. Wir müssen leben bis wir sterben. I blog too now[^]
-
It turns out that VBScript can do [out] parameters, but only if the type of the parameter is VARIANT, as this article[^] explains. -- Weiter, weiter, ins verderben. Wir müssen leben bis wir sterben. I blog too now[^]
-
could I say that if I build a compnent used by VBScript and other script language,the parameter should be dedined VARIANT
For out-parameters, that is a good strategy I'd say, as script languages are often weakly typed. -- Weiter, weiter, ins verderben. Wir müssen leben bis wir sterben. I blog too now[^]