On Aug 30, 2006, at 11:07 AM, Phil M wrote:
Since REALSQLdatabase does not have a Classic compatible plugin, I
think that I have to implement both REALSQLdatabase and REALdatabase.
So how do plugins work?
Do they try to load at app start if the code references the object
within the Plugin (i.e. REALSQLdatabase), or do they only load when
first accessed? Basically I need to know if I *have* to
conditionally compile and split the application into a Classic and
OSX-only builds, or if it is safe to load the appropriate database
plugin based on a Gestalt system call (to determine the OS version).
Also, there was just a post in the Getting Started list where
REALSQLdatabase was not working on a 10.2 system (Jaguar). Is this
true? The REALSQLdatabase documentation only states a limitation
with Classic.
To partly answer my own question, I have the following code in the
Window1.Open() event:
------------------------------
Dim db As Database
Dim dbOld As Boolean
#If TargetCarbon
Dim SysVersion as Integer
If System.Gestalt("sysv", sysVersion) and sysVersion < &h1030 Then
db = New REALDatabase
dbOld = True
Else
db = New REALSQLDatabase
End If
#Elseif TargetMacOSClassic
db = New REALDatabase
dbOld = True
#Endif
If dbOld Then MsgBox "Old database engine." Else MsgBox "New
database engine."
------------------------------
I am compiling the application as Carbon PEF from REALbasic 2006r3
running OS X 10.4.7, and then selecting the "Open in Classic" option
in the Finder's "Get Info". The problem that I am getting is that I
have the following error message:
Runtime Error
Location: Please report what caused this error along with all of
the details above.
Failure Condition: pluginEntryTable.GetEntry(entrypointName,out)
Failure Message: can't find plugin method REALDatabase.__init
Now I was expecting/dreading a similar error message, but the key to
this one is that the error is reporting *REALDatabase* plugin is
failing not REALSQLDatabase. (Note: app compiled for Classic-Only
launches fine with the code above.)
So what is the real error here?
That the Runtime assertion is reporting the wrong database engine, or
that REALDatabase is broken when running a Carbon PEF in Classic?
Keep in mind that I am not running in OS 9, but I have to simulate it
running Classic since I don't have a OS 9 bootable machine available
at the moment.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>