|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using Comm dll file in vb.net 2003 errorusing vb.net 2003 Imported a com dll under Reference Im trying to use one of the classes but keep getting an error: "Object reference not set to an instance of an object." Using it like this: Dim getduration As String Dim rd As BVEvent getduration = rd.Duration MessageBox.Show(getduration) I tried changing this line to this, but gave same error and underlined rd: Dim rd As New BVEvent thanks for any help GV
Show quote
Hide quote
"gv" <viat***@musc.edu> schrieb: A runtime error or a compile time error? 'Dim rd As New BVEvent' should > Imported a com dll under Reference > > Im trying to use one of the classes but keep getting an error: > > "Object reference not set to an instance of an object." > > Using it like this: > > Dim getduration As String > Dim rd As BVEvent > getduration = rd.Duration > MessageBox.Show(getduration) > > I tried changing this line to this, but gave same error and underlined rd: > > Dim rd As New BVEvent work... -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> thanks for your help
thats what i thought but, still underlines the rd with blue squiggly line? thanks GV Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:OshtvDvNFHA.3076@tk2msftngp13.phx.gbl... > "gv" <viat***@musc.edu> schrieb: >> Imported a com dll under Reference >> >> Im trying to use one of the classes but keep getting an error: >> >> "Object reference not set to an instance of an object." >> >> Using it like this: >> >> Dim getduration As String >> Dim rd As BVEvent >> getduration = rd.Duration >> MessageBox.Show(getduration) >> >> I tried changing this line to this, but gave same error and underlined >> rd: >> >> Dim rd As New BVEvent > > A runtime error or a compile time error? 'Dim rd As New BVEvent' should > work... > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> You may need to import the reference too
Imports SomeReference Crouchie1998 BA (HONS) MCP MCSE "gv" <viat***@musc.edu> schrieb: Mhm... Doesn't it underline 'BVEvent'? If the namespace that contains > thats what i thought but, > > still underlines the rd with blue squiggly line? 'BVEvent' is imported ('Imports <namespace>') and you are using 'As New' your code should compile. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> You need to create a new reference to what you are needing to use:
Dim sClass As SomeClass sClass.SomethingHere = SomeValue ' Object not set... ----------------------------- Dim sClass As SomeClass sClass = New SomeClass sClass.SomethingHere = SomeValue ----------------------------- Dim sClass As SomeClass = New SomeClass sClass.SomethingHere = SomeValue I think you get the idea Crouchie1998 BA (HONS) MCP MCSE
sorting files retrieved by OpenFileDialog
Total seconds of day VB.Net Joining Paradox and SQL Server Table? Insert Border around a picture Read private variables between forms touch screen monitors Terminating a thread Resize Tab control when windows form resizes COM, LPT and USB to C, C++ Interface. File locking problem |
|||||||||||||||||||||||