From: Matt S. <mes...@gm...> - 2008-11-13 18:44:57
|
Because OBDotNet was built with SWIG it uses an intermediate managed C++ dll to access OpenBabel. Thats what openbabel.dll is. The program needs to be able to see the full contents of the OBDotNet distribution. Follow the directions in the IronPython instructions with regards to setting environment variables. Remember that VS (I assume thats what your using) by default will copy a referenced assembly to the release/debug directories but won't know to bring any dependencies with it. I'm working on creating an installer for the package but it won't be ready for a while yet. -Matt On Thu, Nov 13, 2008 at 11:33 AM, Brian Bordeau < bri...@am...> wrote: > > Hi Matt, > I've referenced the OBdotnet.dll in my project and based on the errors > am wondering if I missed referencing a library or set up the OBConv > incorrectly. Could you check the following app (in VB.net 2008) and see if > there is anything obvious: > > Imports OpenBabel > > Public Class Form1 > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles Button1.Click > Dim strFolder As String = "c:\Structures\" > Dim OBConv As New OBConversion() > Dim OBBase As New OBBase() > > OBConv.SetInAndOutFormats("sdf", "smi") > > OBConv.ReadFile(OBBase, strFolder & "*.sdf") > OBConv.WriteFile(OBBase, strFolder & "*.smi") > > End Sub > End Class > > I'm getting the error(s) : > > System.TypeInitializationException was unhandled > Message="The type initializer for 'OpenBabel.openbabelPINVOKE' threw an > exception." > Source="OBDotNet" > TypeName="OpenBabel.openbabelPINVOKE" > > and inner exceptions: > > InnerException: System.TypeInitializationException > Message="The type initializer for 'SWIGExceptionHelper' threw an > exception." > Source="OBDotNet" > TypeName="SWIGExceptionHelper" > > and > > InnerException: System.DllNotFoundException > Message="Unable to load DLL 'openbabel': The specified module > could not be found. (Exception from HRESULT: 0x8007007E)" > Source="OBDotNet" > TypeName="" > StackTrace: > at > > OpenBabel.openbabelPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_openbabel(ExceptionDelegate > applicationDelegate, ExceptionDelegate arithmeticDelegate, > ExceptionDelegate > divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, > ExceptionDelegate invalidCastDelegate, ExceptionDelegate > invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate > nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, > ExceptionDelegate overflowDelegate, ExceptionDelegate > systemExceptionDelegate) at > OpenBabel.openbabelPINVOKE.SWIGExceptionHelper..cctor() > InnerException: > > Thanks > > Brian > > > > > > > > Matt Sprague wrote: > > > > Hi Brian, > > > > In regards to your question about OBDotNet it is useable from any > language > > that compiles for the CLR. This includes C#, VB, F#, S# (small talk.net) > > etc. Because all of these languages compile to a common byte code and use > > the FCL (framework class library) the assemblies are mostly > > interchangeable > > and the choice of language is really just a matter of personal > preference. > > VB.Net is a core MS language so OBDotNet should work just fine. Worst > > case, > > if something wasn't supported it just won't be exposed when you reference > > an > > assembly but it won't prevent the rest of the library from functioning. > > > > If you have any further questions or need any help just post to the > > mailing > > list. Noel knows more about OpenBabel and I handle the more specific > > CLR/FCL related stuff. > > > > -Matt Sprague > > > > > > On Thu, Nov 13, 2008 at 12:57 AM, Noel O'Boyle <bao...@gm...> > > wrote: > > > >> 2008/11/13 Bordeau, Brian <Bri...@am...>: > >> > Hi Noel, > >> > > >> > I am relatively new to using open source libraries, > message > >> > boards and the like so I don't know if/how people post messages or > >> > questions. > >> Generally, we cc everything to ope...@li... so > >> that we have a record. I've forwarded your original message. Welcome > >> to open source. :-) > >> > >> > I am a relatively proficient VB.net programmer and would like to > >> > use the OBdotnet.dll library but am not sure if it has been designed > >> for > >> > this purpose – is this library solely for IronPython or could it be > >> used > >> in > >> > a .net program. > >> It's actually designed for .NET. I'm just more interested in > >> IronPython than the other .NET languages. The main OBdotnet developer > >> is interested in C# (Matt Sprague). > >> > >> We welcome feedback on this code, so let us know how it goes. > >> > >> Regards, > >> Noel > >> > >> > ------------------------------------------------------------------------- > >> This SF.Net email is sponsored by the Moblin Your Move Developer's > >> challenge > >> Build the coolest Linux based applications with Moblin SDK & win great > >> prizes > >> Grand prize is a trip for two to an Open Source event anywhere in the > >> world > >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ > >> _______________________________________________ > >> OpenBabel-scripting mailing list > >> Ope...@li... > >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > >> > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > OpenBabel-scripting mailing list > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > > > > -- > View this message in context: > http://www.nabble.com/Re%3A-OBdotnet-tp20476218p20486773.html > Sent from the openbabel-scripting mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > |