I'm using VB.NET to create an add-in for the Google Sidebar, and have
implemented the OnDetailsView method.
NOTE : I've come across this same problem (error message) even in C#.
I tried placing a label control and setting the reference of this new
lable into the 'details_contro l' parameter.
This worked.
How ever, when i tried creating a textbox control and setting the
reference of this textbox to details_control I got the below error
message (NOTE : I tried this even with a user control, button and panel
- but all gave the same error message).
Below is the error message:
-------------------------------------------------------------------
An unhandled except has occurred in a compnent in your application.
Click continue and application will ignore this error and attemp to
continue.
Object reference not set to an instance of an object.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullRefe renceException: Object reference not set to an instance
of an object.
at System.Windows. Forms.ActiveXIm pl.InPlaceActiv ate(Int32 verb)
at System.Windows. Forms.ActiveXIm pl.InPlaceActiv ate(Int32 verb)
at System.Windows. Forms.ActiveXIm pl.OnFocus(Bool ean focus)
at System.Windows. Forms.ActiveXIm pl.OnFocus(Bool ean focus)
at System.Windows. Forms.Control.A ctiveXOnFocus(B oolean focus)
at System.Windows. Forms.Control.O nGotFocus(Event Args e)
at System.Windows. Forms.TextBox.O nGotFocus(Event Args e)
at System.Windows. Forms.Control.W mSetFocus(Messa ge& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.TextBoxBa se.WndProc(Mess age& m)
at System.Windows. Forms.TextBox.W ndProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at
System.Windows. Forms.ActiveXIm pl.System.Windo ws.Forms.IWindo wTarget.OnMessa ge(Message&
m)
at
System.Windows. Forms.ActiveXIm pl.System.Windo ws.Forms.IWindo wTarget.OnMessa ge(Message&
m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
GoogleDesktopDi splayVBSample
Assembly Version: 1.0.2113.34762
Win32 Version: 1.0.2113.34762
CodeBase:
file:///D:/Development/VB.NET/Learn/Temp/WindowsApplicat ion1/bin/GoogleDesktopD isplayVBSample. DLL
----------------------------------------
Interop.GoogleD esktopDisplayLi b
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///D:/Development/VB.NET/Learn/Temp/WindowsApplicat ion1/bin/Interop.Google DesktopDisplayL ib.DLL
----------------------------------------
System.Windows. Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.windows. forms/1.0.5000.0__b77 a5c561934e089/system.windows. forms.dll
----------------------------------------
stdole
Assembly Version: 7.0.3300.0
Win32 Version: 7.00.9466
CodeBase:
file:///c:/windows/assembly/gac/stdole/7.0.3300.0__b03 f5f7f11d50a3a/stdole.dll
----------------------------------------
Microsoft.Visua lBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.6001.4
CodeBase:
file:///c:/windows/assembly/gac/microsoft.visua lbasic/7.0.5000.0__b03 f5f7f11d50a3a/microsoft.visua lbasic.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system/1.0.5000.0__b77 a5c561934e089/system.dll
----------------------------------------
GoogleDesktopDi splayCSharpSamp le
Assembly Version: 1.0.2114.33663
Win32 Version: 1.0.2114.33663
CodeBase:
file:///D:/Development/GD_SDK/api/samples/GoogleDesktopDi splayCSharpSamp le/bin/Debug/GoogleDesktopDi splayCSharpSamp le.DLL
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03 f5f7f11d50a3a/system.drawing. dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config ) must have the
jitDebugging value set in the system.windows. forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuratio n>
<system.windows .forms jitDebugging="t rue" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
-------------------------------------------------------------------
Below is the code i used to place a lable and a textbox on the detail
view of the content item.
This works, how ever, if i use a textbox, button, user control or any
other control i get the above error message.
Public Function OnDetailsView1( ByRef title As String, ByRef flags As
GoogleDesktopDi splayLib.Google DesktopDisplayD etailsViewFlags , ByRef
details_control As Object) As Boolean Implements
GoogleDesktopDi splayLib.IGoogl eDesktopDisplay ContentItem.OnD etailsView
Dim loControl As New Label
loControl.Text = "hello"
details_control = loControl
title = "This is the title"
flags =
GoogleDesktopDi splayDetailsVie wFlags.GDD_DETA ILS_VIEW_FLAG_T OOLBAR_OPEN
Or
GoogleDesktopDi splayDetailsVie wFlags.GDD_DETA ILS_VIEW_FLAG_N EGATIVE_FEEDBAC K
Return False
End Function
Reply
implemented the OnDetailsView method.
NOTE : I've come across this same problem (error message) even in C#.
I tried placing a label control and setting the reference of this new
lable into the 'details_contro l' parameter.
This worked.
How ever, when i tried creating a textbox control and setting the
reference of this textbox to details_control I got the below error
message (NOTE : I tried this even with a user control, button and panel
- but all gave the same error message).
Below is the error message:
-------------------------------------------------------------------
An unhandled except has occurred in a compnent in your application.
Click continue and application will ignore this error and attemp to
continue.
Object reference not set to an instance of an object.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullRefe renceException: Object reference not set to an instance
of an object.
at System.Windows. Forms.ActiveXIm pl.InPlaceActiv ate(Int32 verb)
at System.Windows. Forms.ActiveXIm pl.InPlaceActiv ate(Int32 verb)
at System.Windows. Forms.ActiveXIm pl.OnFocus(Bool ean focus)
at System.Windows. Forms.ActiveXIm pl.OnFocus(Bool ean focus)
at System.Windows. Forms.Control.A ctiveXOnFocus(B oolean focus)
at System.Windows. Forms.Control.O nGotFocus(Event Args e)
at System.Windows. Forms.TextBox.O nGotFocus(Event Args e)
at System.Windows. Forms.Control.W mSetFocus(Messa ge& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.TextBoxBa se.WndProc(Mess age& m)
at System.Windows. Forms.TextBox.W ndProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at
System.Windows. Forms.ActiveXIm pl.System.Windo ws.Forms.IWindo wTarget.OnMessa ge(Message&
m)
at
System.Windows. Forms.ActiveXIm pl.System.Windo ws.Forms.IWindo wTarget.OnMessa ge(Message&
m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
GoogleDesktopDi splayVBSample
Assembly Version: 1.0.2113.34762
Win32 Version: 1.0.2113.34762
CodeBase:
file:///D:/Development/VB.NET/Learn/Temp/WindowsApplicat ion1/bin/GoogleDesktopD isplayVBSample. DLL
----------------------------------------
Interop.GoogleD esktopDisplayLi b
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///D:/Development/VB.NET/Learn/Temp/WindowsApplicat ion1/bin/Interop.Google DesktopDisplayL ib.DLL
----------------------------------------
System.Windows. Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.windows. forms/1.0.5000.0__b77 a5c561934e089/system.windows. forms.dll
----------------------------------------
stdole
Assembly Version: 7.0.3300.0
Win32 Version: 7.00.9466
CodeBase:
file:///c:/windows/assembly/gac/stdole/7.0.3300.0__b03 f5f7f11d50a3a/stdole.dll
----------------------------------------
Microsoft.Visua lBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.6001.4
CodeBase:
file:///c:/windows/assembly/gac/microsoft.visua lbasic/7.0.5000.0__b03 f5f7f11d50a3a/microsoft.visua lbasic.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system/1.0.5000.0__b77 a5c561934e089/system.dll
----------------------------------------
GoogleDesktopDi splayCSharpSamp le
Assembly Version: 1.0.2114.33663
Win32 Version: 1.0.2114.33663
CodeBase:
file:///D:/Development/GD_SDK/api/samples/GoogleDesktopDi splayCSharpSamp le/bin/Debug/GoogleDesktopDi splayCSharpSamp le.DLL
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03 f5f7f11d50a3a/system.drawing. dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config ) must have the
jitDebugging value set in the system.windows. forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuratio n>
<system.windows .forms jitDebugging="t rue" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
-------------------------------------------------------------------
Below is the code i used to place a lable and a textbox on the detail
view of the content item.
This works, how ever, if i use a textbox, button, user control or any
other control i get the above error message.
Public Function OnDetailsView1( ByRef title As String, ByRef flags As
GoogleDesktopDi splayLib.Google DesktopDisplayD etailsViewFlags , ByRef
details_control As Object) As Boolean Implements
GoogleDesktopDi splayLib.IGoogl eDesktopDisplay ContentItem.OnD etailsView
Dim loControl As New Label
loControl.Text = "hello"
details_control = loControl
title = "This is the title"
flags =
GoogleDesktopDi splayDetailsVie wFlags.GDD_DETA ILS_VIEW_FLAG_T OOLBAR_OPEN
Or
GoogleDesktopDi splayDetailsVie wFlags.GDD_DETA ILS_VIEW_FLAG_N EGATIVE_FEEDBAC K
Return False
End Function
Reply