Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ConnectToNewObject Returns -2 or -4

652 views
Skip to first unread message

mimlay

unread,
Oct 18, 2009, 5:54:50 PM10/18/09
to
Hi,

I am attempting to use PowerBuilder 11.5 with ArcGIS Engine 9.3 to
make a Computer Aided Dispatch program for a law enforcement agaency.
So far, I have been able to embed and populate the MapControl.ocx and
ToolbarControl.ocx in PowerBuilder application without problem.

I'm trying to translate a VB script to PowerBuilder to make an address
locator. However, now I'm trying to connect to a new object in the
esriLocation.LocatorManager class and I'm having problems.

Here is the code:

long s_lResults

// Locator Manager Object
OLEObject OLEpLocatorManager

OLEpLocatorManager = CREATE OLEObject

s_lResults = OLEpLocatorManager.ConnectToNewObject
('esriLocation.LocatorManager')

The return value in this case is -2.

If I change the connect line to

s_lResults = OLEpLocatorManager.ConnectToNewObject
('esriLocation.LocatorManager.1')

the return value is -4.

I can see the class information in the browser under the OLE tab under
Programmable Objects.

I know this question has been brought up in the past, but I never saw
a resolution to the problem.

The esriLocation file is an .olb file in another directory. Is that a
problem?

Thanks for any info you can provide.

Mary Imlay


Beeps

unread,
Oct 19, 2009, 6:03:51 PM10/19/09
to
Try using DLLRegisterServer() before creating the OLEObject
0 new messages