Hammerhead with FDO 3.2.x and fdopostgis

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Hammerhead with FDO 3.2.x and fdopostgis

Mateusz Loskot
Hi All,

I'm having some strange problems with using FDO 3.2.x branch
and my fdopostgis provider, under Map 3D Hammerhead.
I'm using FDO 3.2.x from following branch:

http://svn.osgeo.org/svn/fdordbms/branches/3.2.x/

The fdopostgis provider builds against 3.2.x without problems.
Also, simple tests of load/connect/disconnect work well.
Now, I'm trying to check it with Map 3D Hammerhead and

I'm encountering two problems:

1) The provider (PostGisProvider.dll) can be loaded, but no entry point
seems to be found. Here is screenshot with some details (marked with red
lines) that I managed to get under debugger attached to acad.exe:

http://mateusz.loskot.net/tmp/fdopostgis-hh-noentry.png

I suppose the "Entry point not found" message is telling me that
address of the CreateConnection() call exported from PostGisProvider.dll
can not be found. Second, I have some logging action inside my
CreateConnection() but it's not executed.

I've made some diagnostics of my PostGisProvider.dll and I'm pretty
sure it's well baked well, because:


a) dumpbin.exe /exports PostGisProvider.dll
lists exported CreateConnection() call:

1   17 0004717C CreateConnection = @ILT+375(_CreateConnection)


b) Simple test using command line program does work well.
I can step all calls and everything works:

- FdoConnectionManager::CreateConnection()
-- LoadLibrary - OK
-- GetProcAddress of CreateConnection() from PostGisProvider.dll - OK
--- call PostGisProvider.dll::CreateConnection() - OK
---- I get valid pointer to FdoIConnection interface
----- I can use the pointer to connect with PostGIS datastore

//////////////////////////////////////////////////////////////////////
std::wstring provider(L"OSGeo.PostGIS.3.2");
std::wstring
connStr(L"service=fdo_test;username=m;password=x;datastore=tmp");

FdoPtr<IConnectionManager> mgr;
mgr = FdoFeatureAccessManager::GetConnectionManager();

FdoPtr<FdoIConnection> conn;
conn = mgr->CreateConnection(provider.c_str());
conn->SetConnectionString(connStr.c_str());
FdoConnectionState state = conn->Open();
//////////////////////////////////////////////////////////////////////


Summarizing, from a) and b) I assume the fdopostgis interface is
obtainable and usable.


2) Second problem is related to FDO 3.2.x.
As I understand and got confirmation from Bob, the Hammerhead works with
FDO 3.2.x, so I tried to replace original Hammerhead libraries with my
homebaked from the 3.2.x branch:
FDO.dll, FDOCommon.dll, FDOGeometry.dll and FDOSpatial.dll

Unfortunately, just after Hammerhead starts, I got something like this:

http://mateusz.loskot.net/tmp/hh-with-fdocore-3.2.0.png

Also, I can not access File -> Data Connect options


Does anyone see I'm doing wrong or I'm missing something?

I'd be very thankful for some assistance in getting Hammerhead
working with provider built against FDO 3.2.x branch.

BTW, is there any way to get low-level detailed log from Hammerhead,
some backtrace, etc.?


Cheers
--
Mateusz Loskot
http://mateusz.loskot.net
_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Reply | Threaded
Open this post in threaded view
|

RE: Hammerhead with FDO 3.2.x and fdopostgis

Robert Fortin
Mateusz,

I'm not sure that's the issue but it might be caused by the submission
from Romi which change Idisposable to have virtual functions.  I believe
this is breaking binary compatibility and cause the problem you are
seeing with Hammerhead.

I would suggest that you rollback Romi's change in your environment and
recompile FDO + your provider.

Hope it helps.

RF

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Mateusz
Loskot
Sent: Wednesday, February 07, 2007 5:13 AM
To: fdo-internals
Subject: [fdo-internals] Hammerhead with FDO 3.2.x and fdopostgis

Hi All,

I'm having some strange problems with using FDO 3.2.x branch and my
fdopostgis provider, under Map 3D Hammerhead.
I'm using FDO 3.2.x from following branch:

http://svn.osgeo.org/svn/fdordbms/branches/3.2.x/

The fdopostgis provider builds against 3.2.x without problems.
Also, simple tests of load/connect/disconnect work well.
Now, I'm trying to check it with Map 3D Hammerhead and

I'm encountering two problems:

1) The provider (PostGisProvider.dll) can be loaded, but no entry point
seems to be found. Here is screenshot with some details (marked with red
lines) that I managed to get under debugger attached to acad.exe:

http://mateusz.loskot.net/tmp/fdopostgis-hh-noentry.png

I suppose the "Entry point not found" message is telling me that address
of the CreateConnection() call exported from PostGisProvider.dll can not
be found. Second, I have some logging action inside my
CreateConnection() but it's not executed.

I've made some diagnostics of my PostGisProvider.dll and I'm pretty sure
it's well baked well, because:


a) dumpbin.exe /exports PostGisProvider.dll lists exported
CreateConnection() call:

1   17 0004717C CreateConnection = @ILT+375(_CreateConnection)


b) Simple test using command line program does work well.
I can step all calls and everything works:

- FdoConnectionManager::CreateConnection()
-- LoadLibrary - OK
-- GetProcAddress of CreateConnection() from PostGisProvider.dll - OK
--- call PostGisProvider.dll::CreateConnection() - OK
---- I get valid pointer to FdoIConnection interface
----- I can use the pointer to connect with PostGIS datastore

//////////////////////////////////////////////////////////////////////
std::wstring provider(L"OSGeo.PostGIS.3.2"); std::wstring
connStr(L"service=fdo_test;username=m;password=x;datastore=tmp");

FdoPtr<IConnectionManager> mgr;
mgr = FdoFeatureAccessManager::GetConnectionManager();

FdoPtr<FdoIConnection> conn;
conn = mgr->CreateConnection(provider.c_str());
conn->SetConnectionString(connStr.c_str());
FdoConnectionState state = conn->Open();
//////////////////////////////////////////////////////////////////////


Summarizing, from a) and b) I assume the fdopostgis interface is
obtainable and usable.


2) Second problem is related to FDO 3.2.x.
As I understand and got confirmation from Bob, the Hammerhead works with
FDO 3.2.x, so I tried to replace original Hammerhead libraries with my
homebaked from the 3.2.x branch:
FDO.dll, FDOCommon.dll, FDOGeometry.dll and FDOSpatial.dll

Unfortunately, just after Hammerhead starts, I got something like this:

http://mateusz.loskot.net/tmp/hh-with-fdocore-3.2.0.png

Also, I can not access File -> Data Connect options


Does anyone see I'm doing wrong or I'm missing something?

I'd be very thankful for some assistance in getting Hammerhead working
with provider built against FDO 3.2.x branch.

BTW, is there any way to get low-level detailed log from Hammerhead,
some backtrace, etc.?


Cheers
--
Mateusz Loskot
http://mateusz.loskot.net
_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals


Author: romicadascalescu
Date: 2007-01-26 12:49:11 -0500 (Fri, 26 Jan 2007)
New Revision: 679

Modified:
   trunk/Fdo/Unmanaged/Inc/Common/IDisposable.h
   trunk/Fdo/Unmanaged/Inc/Common/Ptr.h
Log:
Adding virtual to FdoIDisposable: AddRef,Release,GetRefCount

Modified: trunk/Fdo/Unmanaged/Inc/Common/IDisposable.h
===================================================================
--- trunk/Fdo/Unmanaged/Inc/Common/IDisposable.h 2007-01-26 17:48:40 UTC (rev 678)
+++ trunk/Fdo/Unmanaged/Inc/Common/IDisposable.h 2007-01-26 17:49:11 UTC (rev 679)
@@ -60,7 +60,7 @@
     /// \return
     /// Returns the new reference count (value for debugging use only).
     ///
-    FDO_API_COMMON FdoInt32 AddRef() { return ++m_refCount; }
+    FDO_API_COMMON virtual FdoInt32 AddRef() { return ++m_refCount; }
 
     /// \brief
     /// Decrease the reference count.
@@ -68,7 +68,7 @@
     /// \return
     /// Returns the new reference count (value for debugging use only).
     ///
-    FDO_API_COMMON FdoInt32 Release() { if (0 != --m_refCount ) return m_refCount; Dispose(); return 0; }
+    FDO_API_COMMON virtual FdoInt32 Release() { if (0 != --m_refCount ) return m_refCount; Dispose(); return 0; }
 
     /// \brief
     /// Retrieves the reference count.
@@ -76,7 +76,7 @@
     /// \return
     /// Returns the existing reference count value.
     ///
-    FDO_API_COMMON FdoInt32 GetRefCount() { return m_refCount; }
+    FDO_API_COMMON virtual FdoInt32 GetRefCount() { return m_refCount; }
 
 private:
     FdoInt32    m_refCount;

Modified: trunk/Fdo/Unmanaged/Inc/Common/Ptr.h
===================================================================
--- trunk/Fdo/Unmanaged/Inc/Common/Ptr.h 2007-01-26 17:48:40 UTC (rev 678)
+++ trunk/Fdo/Unmanaged/Inc/Common/Ptr.h 2007-01-26 17:49:11 UTC (rev 679)
@@ -30,8 +30,8 @@
 class _NoAddRefReleaseOnFdoPtr : public T
 {
     private:
-        virtual void AddRef()  = 0;
-        virtual void Release() = 0;
+        virtual FdoInt32 AddRef()  = 0;
+        virtual FdoInt32 Release() = 0;
 };
 
 template <class T>

_______________________________________________
fdo-commits mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-commits

_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Reply | Threaded
Open this post in threaded view
|

Re: Hammerhead with FDO 3.2.x and fdopostgis

Mateusz Loskot
Robert Fortin wrote:
> Mateusz,
>
> I'm not sure that's the issue but it might be caused by the submission
> from Romi which change Idisposable to have virtual functions.  I believe
> this is breaking binary compatibility and cause the problem you are
> seeing with Hammerhead.
>
> I would suggest that you rollback Romi's change in your
> environment and recompile FDO + your provider.


Robert,

Yes, that may be the reason.
Romica applied submitted this change in r678,

http://trac.osgeo.org/trac/fdo/changeset/678

and I use FDO 3.2.x of r719.

I think I'll try to rollback to prior 678, but am I correct I also
need to replace original .NET libraries (MgFdo*.dll) with those from
built together with my compilation of FDO core ?

Thanks for your help
--
Mateusz Loskot
http://mateusz.loskot.net
_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Reply | Threaded
Open this post in threaded view
|

RE: Hammerhead with FDO 3.2.x and fdopostgis

Robert Fortin
Actually, if you rollback Romi's change and do a new build with it, I
believe you will only need the provider dll.
The rest should all be binary compatible.

RF

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Mateusz
Loskot
Sent: Wednesday, February 07, 2007 11:59 PM
To: FDO Internals Mail List
Subject: Re: [fdo-internals] Hammerhead with FDO 3.2.x and fdopostgis

Robert Fortin wrote:
> Mateusz,
>
> I'm not sure that's the issue but it might be caused by the submission

> from Romi which change Idisposable to have virtual functions.  I
> believe this is breaking binary compatibility and cause the problem
> you are seeing with Hammerhead.
>
> I would suggest that you rollback Romi's change in your environment
> and recompile FDO + your provider.


Robert,

Yes, that may be the reason.
Romica applied submitted this change in r678,

http://trac.osgeo.org/trac/fdo/changeset/678

and I use FDO 3.2.x of r719.

I think I'll try to rollback to prior 678, but am I correct I also need
to replace original .NET libraries (MgFdo*.dll) with those from built
together with my compilation of FDO core ?

Thanks for your help
--
Mateusz Loskot
http://mateusz.loskot.net
_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals

_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Reply | Threaded
Open this post in threaded view
|

RE: Hammerhead with FDO 3.2.x and fdopostgis

Romica Dascalescu

You need only provider libraries without building and copying the NET
libraries.
It's enough to roll back two files and clean projects and rebuild them:
\\Fdo\Unmanaged\Inc\Common\IDisposable.h
\\Fdo\Unmanaged\Inc\Common\Ptr.h

Romica.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Robert
Fortin
Sent: Thursday, February 08, 2007 10:51 AM
To: FDO Internals Mail List
Subject: RE: [fdo-internals] Hammerhead with FDO 3.2.x and fdopostgis

Actually, if you rollback Romi's change and do a new build with it, I
believe you will only need the provider dll.
The rest should all be binary compatible.

RF

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Mateusz
Loskot
Sent: Wednesday, February 07, 2007 11:59 PM
To: FDO Internals Mail List
Subject: Re: [fdo-internals] Hammerhead with FDO 3.2.x and fdopostgis

Robert Fortin wrote:
> Mateusz,
>
> I'm not sure that's the issue but it might be caused by the submission

> from Romi which change Idisposable to have virtual functions.  I
> believe this is breaking binary compatibility and cause the problem
> you are seeing with Hammerhead.
>
> I would suggest that you rollback Romi's change in your environment
> and recompile FDO + your provider.


Robert,

Yes, that may be the reason.
Romica applied submitted this change in r678,

http://trac.osgeo.org/trac/fdo/changeset/678

and I use FDO 3.2.x of r719.

I think I'll try to rollback to prior 678, but am I correct I also need
to replace original .NET libraries (MgFdo*.dll) with those from built
together with my compilation of FDO core ?

Thanks for your help
--
Mateusz Loskot
http://mateusz.loskot.net
_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals

_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals

_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Reply | Threaded
Open this post in threaded view
|

Re: Hammerhead with FDO 3.2.x and fdopostgis

Mateusz Loskot
Romica Dascalescu wrote:
> You need only provider libraries without building and copying the NET
>  libraries. It's enough to roll back two files and clean projects and
>  rebuild them: \\Fdo\Unmanaged\Inc\Common\IDisposable.h
> \\Fdo\Unmanaged\Inc\Common\Ptr.h


Romica,

I confirm it works.
After getting back non-virtual calls, I can load and use my provider
with the AutoCAD Map 3D 2008.
Thanks!
--
Mateusz Loskot
http://mateusz.loskot.net
_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals