|
-
Feb 6th, 2007, 04:12 PM
#1
Thread Starter
New Member
calling a subroutine from a dll
Dear All,
Hope you have a good time. I work on a VB .net plug in . When I call two subroutines from another class as below: I see the first msgbox result but after I click ok on the first msgbox, both, my plug in and main programme will be closed.
VB Code:
Call cls1DEngine.set_openmi_ief(m_1DProjectFilename, m_1DProjectFilename.Length)
MsgBox("set_openmi passed")
Call cls1DEngine.initialise()
MsgBox("set_openmi passed")
these subroutines call two subroutine from ILM_omi.dll and they appear in Cls1DEngine as below:
VB Code:
<DllImport("C:\bin\ILM_omi.dll")> _
Shared Sub set_openmi_ief(ByVal FileName As String, ByVal Length As Integer)
' No code here
End Sub
<DllImport("C:\bin\ILM_omi.dll")> _
Shared Sub initialise()
' No code here
End Sub
Does any body know what the problem is? And also why all related windows closing down when initialise sub is called.
Many Thanks,
Reza
Last edited by immoral; Feb 6th, 2007 at 04:23 PM.
-
Feb 6th, 2007, 09:53 PM
#2
Re: calling a subroutine from a dll
Try putting that code in a Try..Catch block to find out why it is throwing an exception.
-
Feb 7th, 2007, 06:35 AM
#3
Thread Starter
New Member
Re: calling a subroutine from a dll
Dear Edneeis,
I have tried it with try and catch box, too. But it doesn't throw any exception and closes down when it gets there regardless of try and catch box. Do you have any idea?
Many thanks,
Reza
-
Feb 7th, 2007, 11:15 PM
#4
Re: calling a subroutine from a dll
What kind of DLL is C:\bin\ILM_omi.dll? Was it written in .NET? If so then you are doing it wrong. You should be adding a reference to the dll and referring to its objects.
If that is not it then post the code with the try...catch.
-
Feb 12th, 2007, 02:33 PM
#5
Thread Starter
New Member
Re: calling a subroutine from a dll
it is a fortran subroutine. and it is not in .net.
-
Feb 12th, 2007, 02:52 PM
#6
Re: calling a subroutine from a dll
are you sure you are importing the correct DLL function names?
initialise isn't spelled correctly (it should be initialize) unless the DLL has it spelled wrong as well.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|