Currently my app is STAThread in the Sub Main of the assembly that uses
the Clipboard.SetDa taOjbect method as shown here:
Module modBase
<STAThread()> Public Sub Main()
Try
Application.Run (New frmScaleImage)
Catch ex As Exception
Dim strError As String
If gblnTEST_MODE Then
strError = "TESTMODE: frmInput.Main() "
Else
strError = "frmInput.Main( )"
End If
WriteToEventLog (strError, ex.ToString)
MsgBox("An unexpected application error has occurred." &
vbCrLf & vbCrLf & _
"Please leave this message on the screen and
call a programmer." & _
strError & vbCrLf & vbCrLf & ex.ToString)
End Try
End Sub
My Catch didn't 'catch' this error either.
The app worked fine today for a while but just now blew up. This is why
I am saying that the consistency if frustrating.
This is the error I got today when using the app:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Threadin g.ThreadStateEx ception: The current thread must set to
Single Thread Apartment (STA) mode before OLE calls can be made. Ensure
that your Main function has STAThreadAttrib ute marked on it.
at System.Windows. Forms.Clipboard .SetDataObject( Object data, Boolean
copy)
at System.Windows. Forms.Clipboard .SetDataObject( Object data)
at ScaleImage.frmS caleImage.tdbgD ata_Click(Objec t sender, EventArgs
e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at C1.Win.C1TrueDB Grid.BaseGrid.F rame.OnClick(Ev entArgs e)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at C1.Win.C1TrueDB Grid.C1TrueDBGr id.WndProc(Mess age& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(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.573
CodeBase:
file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03 f5f7f11d50
a3a/system.drawing. dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/system/1.0.5000.0__b77 a5c561934e089/syst
em.dll
----------------------------------------
RegexAssembly8_ 0
Assembly Version: 0.0.0.0
Win32 Version: n/a
CodeBase:
----------------------------------------
IEExecRemote
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/ieexecremote/1.0.5000.0__b03 f5f7f11d50a3
a/ieexecremote.dl l
----------------------------------------
Stub
Assembly Version: 1.0.1525.15805
Win32 Version: n/a
CodeBase:
http://intranet.taglab.org/TMR/ScaleApps/Stub.EXE
----------------------------------------
System.Windows. Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/system.windows. forms/1.0.5000.0__b77 a5c5
61934e089/system.windows. forms.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77 a5c561934e089/
system.xml.dll
----------------------------------------
Microsoft.Visua lBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3052.4
CodeBase:
file:///c:/windows/assembly/gac/microsoft.visua lbasic/7.0.5000.0__b03 f5f
7f11d50a3a/microsoft.visua lbasic.dll
----------------------------------------
ScaleImage
Assembly Version: 1.1.1525.25632
Win32 Version: n/a
CodeBase:
http://intranet.taglab.org/TMR/ScaleApps/ScaleImage.DLL
----------------------------------------
C1.Win.C1TrueDB Grid
Assembly Version: 1.2.20033.30829
Win32 Version: 1.2.20034.31024
CodeBase:
file:///c:/windows/assembly/gac/c1.win.c1truedb grid/1.2.20033.30829 __75a
e3fb0e2b1e0da/c1.win.c1truedb grid.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77 a5c561934e089
/system.data.dll
----------------------------------------
C1.Common
Assembly Version: 1.0.20031.116
Win32 Version: 1.0.20031.117
CodeBase:
file:///c:/windows/assembly/gac/c1.common/1.0.20031.116__ e272bb32d11b194
8/c1.common.dll
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03 f5f7f11d50a
3a/accessibility.d ll
----------------------------------------
************** 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.
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!