BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delphi 8 + BDE + Library + Unmanaged caller = DOA

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Soup
Guest





PostPosted: Fri Jan 02, 2004 11:10 am    Post subject: Delphi 8 + BDE + Library + Unmanaged caller = DOA Reply with quote



The following code example works fine in an all managed environment, all
Delphi 8, or linked in from C# (in fact you can reference the shared
libraries in "C:Program FilesCommon FilesBorland SharedBDSShared
Assemblies2.0" and do it all in C# if you are so inclined... and it
works, quite well in fact).

*However* if you compile it into a dll and invoke it from unmanaged code
(like oh, say... a Delphi 7 app), it dies with the following error:
"Function pointer was not created by a Delegate." Playing around with
explicit creation of TSessions and TDatabases suggest that the first BDE
related control to attempt Open/Active/etc will always die with the same
error.

m_bdeTable := TTable.Create(nil);
m_bdeTable.DatabaseName := 'c:scratch';
m_bdeTable.TableName := 'test.db';
m_bdeTable.Active := true; // <- Dies

This is a sticking point to transitioning existing Delphi 7 code into
managed libraries so I'm hoping someone has a solution. I've tried
manually creating TApplications and assigned parents and other bizarre
fix attempts but to no avail. Any suggestions would be appreciated.

Thanks in advance for your time,
Damon

Back to top
Jeff
Guest





PostPosted: Fri Jan 30, 2004 7:14 am    Post subject: Re: Delphi 8 + BDE + Library + Unmanaged caller = DOA Reply with quote



With a licensed copy of Delphi 8 is it possible to reference and use
BDE.NET from within VB.NET and any other CLR language. Does anyone
know if BDE.NET is thread safe?




Soup <nada (AT) nil (DOT) null> wrote

Quote:
The following code example works fine in an all managed environment, all
Delphi 8, or linked in from C# (in fact you can reference the shared
libraries in "C:Program FilesCommon FilesBorland SharedBDSShared
Assemblies2.0" and do it all in C# if you are so inclined... and it
works, quite well in fact).

*However* if you compile it into a dll and invoke it from unmanaged code
(like oh, say... a Delphi 7 app), it dies with the following error:
"Function pointer was not created by a Delegate." Playing around with
explicit creation of TSessions and TDatabases suggest that the first BDE
related control to attempt Open/Active/etc will always die with the same
error.

m_bdeTable := TTable.Create(nil);
m_bdeTable.DatabaseName := 'c:scratch';
m_bdeTable.TableName := 'test.db';
m_bdeTable.Active := true; // <- Dies

This is a sticking point to transitioning existing Delphi 7 code into
managed libraries so I'm hoping someone has a solution. I've tried
manually creating TApplications and assigned parents and other bizarre
fix attempts but to no avail. Any suggestions would be appreciated.

Thanks in advance for your time,
Damon

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.