Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2005

Tip: Looking for answers? Try searching our database.

ASP.NET nullreference

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Zabby - 15 Sep 2005 11:39 GMT
hi following problem in my asp.net project:

i have embedded folloging ocx object in my aspx html code:
<OBJECT id="VideoCapX1" style="Z-INDEX: 101; LEFT: 216px; WIDTH: 368px;
POSITION: absolute; TOP: 120px; HEIGHT: 288px"
                classid="clsid:912FB007-DD9A-11D3-BD8D-DAAFCB8D9378" >

then i want to get the object in my aspx.vb code...

Protected WithEvents VideoCapX1 As VIDEOCAPXLib.VideoCapX
VideoCapX1 = CType(Me.FindControl("VideoCapX1"), VIDEOCAPXLib.VideoCapX)

okay...now i want to change a property of it:
VideoCapX1.Connected = False

and there´s the error message at "VideoCapX1.Connected = False":

"Object reference not set to an instance of an object"
"System.NullReferenceException: Object reference not set to an instance of
an object"

can anyone help me? :(
Cowboy (Gregory A. Beamer) - MVP - 15 Sep 2005 13:19 GMT
My advice is to get away from the embedded object reference and move
completely to code behind. To do this, you will be best served by creating a
.NET wrapper. If you use Visual Studio, adding a COM reference creates the
wrapper for you. If not, use tlbimp.exe to create the wrapper.

I am not fond of declaratively setting up an object that has to be used
programatically. Your mileage may vary. :-)

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

> hi following problem in my asp.net project:
>
[quoted text clipped - 18 lines]
>
> can anyone help me? :(

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.