Jay,
I am replying on behalf of Richard.
On our a Windows 2000 Production database server, a .NET Windows Service
called the PDCProcessor is unable to communicate with MapObjects COM
code to spatially register a point.
The box has the .NET Framework 1.0 and SDK installed and uses MapObjects
2.3.
Any ideas would be great!
1. This exception is thrown when we attempt to connect to the spatial
database to spatially register a point.
Event Type: Error
Event Source: PDCProcessor
Event Category: None
Event ID: 1
Date: 09/11/2004
Time: 16:08:06
User: N/A
Computer: RIMVDBS02
Description:
The description for Event ID ( 1 ) in Source ( PDCProcessor ) cannot be
found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote
computer. The following information is part of the event: 2004-11-09
16:08:06,817 [5308] FATAL Logica.RIMNET3.DAL.clsSpatialConnection -
SystemException Exception Type = System.InvalidCastException
Exception Message = QueryInterface for interface
ESRI.MapObjects2.Core.IMoDataConnection failed.
Exception Stack = at System.RuntimeType.InvokeDispMethod(String name,
BindingFlags invokeAttr, Object target, Object[] args, Boolean[]
byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters)
at System.RuntimeType.ForwardCallToInvokeMember(Strin g memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at ESRI.MapObjects2.Core.DataConnectionClass.set_Serv er(String A_1)
at Logica.RIMNET3.DAL.clsSpatialConnection.connectSDE (Boolean
boolRefDB)
..
2. This exception is thrown when we attempt to convert a grid reference
to an easting-northing.
Event Type: Error
Event Source: PDCProcessor
Event Category: None
Event ID: 0
Date: 09/11/2004
Time: 16:09:41
User: N/A
Computer: RIMVDBS02
Description:
The description for Event ID ( 0 ) in Source ( PDCProcessor ) cannot be
found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote
computer. The following information is part of the event: 2004-11-09
16:09:41,055 [3940] ERROR Logica.RIMNET3.GAD.clsPointConversion -
Exception: System.InvalidCastException
Message: QueryInterface for interface ESRI.MapObjects2.Core.IMoPoint
failed.
Source: mscorlib
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers,
Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters)
at System.RuntimeType.ForwardCallToInvokeMember(Strin g memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at ESRI.MapObjects2.Core.PointClass.set_X(Double A_1)
at
Logica.RIMNET3.GAD.clsPointConversion.gridRefToEas tingNorthing(String
strGridRef, enmProjectionTypes& i32Projection)
..
3. The code that generates the second exception is:
Imports ESRI.MapObjects2.Core
Imports Logica.RIMNET3.DataAccess.Framework
Imports Logica.RIMNET3.DataAccess.SqlServer
Imports Logica.RIMNET3.common
Public Function gridRefToEastingNorthing(ByVal strGridRef As String,
ByRef i32Projection As enmProjectionTypes) As Point
'-----------------------------------------------------------------------
---
' Declarations
'-----------------------------------------------------------------------
---
Dim objPoint As Point
'-----------------------------------------------------------------------
---
' Database Declarations
'-----------------------------------------------------------------------
---
Dim objRequest As New DARequest()
Dim objFactory As DAFactory
Dim i32Easting As Int32
Dim i32Northing As Int32
Try
'-----------------------------------------------------------------------
---
' Setup the stored procedure
'-----------------------------------------------------------------------
---
objFactory = New SqlDataAccessHelper(m_i32OperatingMode)
objRequest.Command =
m_strSP_CONVERT_GRID_REF_TO_EAST_NORTH
'-----------------------------------------------------------------------
---
' Setup the parameters
'-----------------------------------------------------------------------
---
objRequest.PopulateParams(m_strARG_GRID_REF, strGridRef,
False)
objRequest.PopulateParams(m_strARG_REGION_CODE, "",
True)
objRequest.PopulateParams(m_strARG_EASTING, i32Easting,
True)
objRequest.PopulateParams(m_strARG_NORTHING,
i32Northing, True)
'-----------------------------------------------------------------------
---
' Get the converted NGR value
'-----------------------------------------------------------------------
---
objFactory.ExecuteNonQuery(objRequest)
If Not objRequest.GetParamValue(m_strARG_REGION_CODE) Is
System.DBNull.Value _
AndAlso Not
objRequest.GetParamValue(m_strARG_EASTING) Is System.DBNull.Value _
AndAlso Not
objRequest.GetParamValue(m_strARG_NORTHING) Is System.DBNull.Value Then
Select Case
CStr(objRequest.GetParamValue(m_strARG_REGION_CODE ))
Case m_strGRID_CODE_GB
i32Projection =
enmProjectionTypes.BritishNationalGrid
Case m_strGRID_CODE_IE
i32Projection =
enmProjectionTypes.IrishNationalGrid
Case m_strGRID_CODE_CI
i32Projection =
enmProjectionTypes.ChannelIslands
End Select
objPoint = New Point()
objPoint.X =
CDbl(objRequest.GetParamValue(m_strARG_EASTING))
objPoint.Y =
CDbl(objRequest.GetParamValue(m_strARG_NORTHING))
End If
Catch objDAExcp As DAException
If m_objLog.IsErrorEnabled Then
m_objLog.Error(objDAExcp)
Catch objExcp As Exception
If m_objLog.IsErrorEnabled Then m_objLog.Error(objExcp)
End Try
'-----------------------------------------------------------------------
---
' Return from the function
'-----------------------------------------------------------------------
---
If IsNothing(i32Projection) Or IsNothing(objPoint) Then
Throw New EastNorthNotObtainedException()
Else
Return objPoint
End If
End Function
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!