|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DLL returns a variant data type - how to convert and use in VB .NETDim FaxMsg As IFaxMessage Set FaxMsg = gFC.NewMessage Dim Recip As Variant ' add a recipient to the fax recipients collection Set Recip = FaxMsg.Recipients.Add(0) Recip.Name = sWho Recip.Company = sCompany Recip.FaxNumber = sPhone The problem I am having is that variant type does not exist in .NET and FaxMsg.Recipients.Add(0) returns a variant type. I have Option Strict and Option Explicit set to On. The upgrade utility converts the Variant to type Object which is no good as I can't access Name, Company and FaxNumber properties of Recip. Thanks in advance Darren Benn MCSD darren.b***@chaucerplc.com wrote:
Show quoteHide quote > I need to convert this code to VB .NET (2003). I never worked much with variants, but maybe you could create a> > Dim FaxMsg As IFaxMessage > > Set FaxMsg = gFC.NewMessage > > Dim Recip As Variant > ' add a recipient to the fax recipients collection > Set Recip = FaxMsg.Recipients.Add(0) > Recip.Name = sWho > Recip.Company = sCompany > Recip.FaxNumber = sPhone > > The problem I am having is that variant type does not exist in .NET and > > FaxMsg.Recipients.Add(0) returns a variant type. I have Option Strict > and > Option Explicit set to On. The upgrade utility converts the Variant to > type > Object which is no good as I can't access Name, Company and FaxNumber > properties of Recip. > > Thanks in advance > > Darren Benn > MCSD structure MyStruct which has Name, Company, FaxNumber? Do you have access to FaxMsg.Recipients.Add(0) to change it? If not, could maybe try Dim Recip as MyStruct = CType(FaxMsg.Recipients.Add(0),MyStruct)
OLEDBCommand vs. SQLCommand
Using XPath Against A Node Close a form after x amount of time HTML help files how to use table in a dataset as data source for combobox? cUpdate Custom attribut with reflection Confusing Arraylist BinarySearch problem Insert key press in text box Re: Which do you prefer? XML File into a SQL table |
|||||||||||||||||||||||