Click here to Skip to main content
15,914,820 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: String.Formate with { character Pin
Aftab Sindhi18-Nov-07 19:28
Aftab Sindhi18-Nov-07 19:28 
GeneralRe: String.Formate with { character Pin
Luc Pattyn19-Nov-07 1:17
sitebuilderLuc Pattyn19-Nov-07 1:17 
QuestionProblem with Private Font Collection Pin
bob_up17-Nov-07 4:38
bob_up17-Nov-07 4:38 
AnswerRe: Problem with Private Font Collection Pin
supercat917-Nov-07 10:10
supercat917-Nov-07 10:10 
QuestionInterface FORTRAN90 to VisualBasic - DLL Pin
Sergio2santos17-Nov-07 1:59
Sergio2santos17-Nov-07 1:59 
AnswerRe: Interface FORTRAN90 to VisualBasic - DLL Pin
Luc Pattyn17-Nov-07 2:24
sitebuilderLuc Pattyn17-Nov-07 2:24 
AnswerRe: Interface FORTRAN90 to VisualBasic - DLL Pin
DQNOK19-Nov-07 12:55
professionalDQNOK19-Nov-07 12:55 
GeneralRe: Interface FORTRAN90 to VisualBasic - DLL Pin
Sergio2santos19-Nov-07 14:21
Sergio2santos19-Nov-07 14:21 
Hi! Yes it works perfectly. However I have not been able to pass characters and strings from Fortran90 to VisualBasic6. No luck on this one.
Here it is an upgraded version of the code.

Fortran code
SUBROUTINE square(a)
!MS$ATTRIBUTES DLLEXPORT, ALIAS:'Square'::Square
real*4 a
a = a*a
END SUBROUTINE

SUBROUTINE caracter(s)
!MS$ATTRIBUTES DLLEXPORT, ALIAS:'CARACTER'::CARACTER
character(2) s
s = 'T'
END SUBROUTINE

SUBROUTINE arraytest(arr)
!MS$ATTRIBUTES DLLEXPORT, ALIAS:'ARRAYTEST'::ARRAYTEST
real*4 arr(3,7)
integer i,j
do i=1,3
do j=1,7
arr(i,j) = 11*i+j-1*i
end do
end do
END SUBROUTINE

SUBROUTINE Simarray(arrs)
!MS$ATTRIBUTES DLLEXPORT, ALIAS:'SIMARRAY'::SIMARRAY
real*4 arrs(10)
integer i
arrs(1)=1
do i=2,10
arrs(i) = arrs(i-1)+1
end do
END SUBROUTINE

Visual Basic code
Vb-Fort.vb
Public Class FortranLab

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Single
a = 10
Call Square(a)
TextBox1.Text = Str$(a)
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim i, j As Integer
Static arr(0 To 3, 0 To 7) As Single
Call ARRAYTEST(arr(1, 1))
For i% = 1 To 3
For j% = 1 To 7
TextBox1.Text = Str$(arr(i%, j%)) + TextBox1.Text
Next j%
Next i%
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim i As Integer
Static arr(0 To 10) As Single
Call SIMARRAY(arr(1))
For i% = 1 To 10
TextBox1.Text = Str$(arr(i%)) + TextBox1.Text
Next i%
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox1.Text = " "
End Sub
End Class

Golobal1.bas
Module Global1
Declare Sub ARRAYTEST Lib "c:\FORTDLL\Debug\FORTDLL.dll" (ByRef MyArray As Single)
Declare Sub SIMARRAY Lib "c:\FORTDLL\Debug\FORTDLL.dll" (ByRef MyArray As Single)
Declare Sub Square Lib "c:\FORTDLL\Debug\FORTDLL.dll" (ByRef a As Single)
End Module
GeneralRe: Interface FORTRAN90 to VisualBasic - DLL Pin
DQNOK20-Nov-07 3:55
professionalDQNOK20-Nov-07 3:55 
Question[2008] Make a Documents.FixedPage from an XML literal? Pin
Duncan Edwards Jones17-Nov-07 0:33
professionalDuncan Edwards Jones17-Nov-07 0:33 
QuestionHow to search a PDF document Pin
midnightshifting16-Nov-07 21:19
midnightshifting16-Nov-07 21:19 
AnswerRe: How to search a PDF document Pin
DigiOz Multimedia17-Nov-07 4:55
DigiOz Multimedia17-Nov-07 4:55 
QuestionRestart System when printing Report in VB.net Pin
mashouri16-Nov-07 19:51
mashouri16-Nov-07 19:51 
AnswerRe: Restart System when printing Report in VB.net Pin
DigiOz Multimedia17-Nov-07 4:51
DigiOz Multimedia17-Nov-07 4:51 
QuestionHandling Valuemember of Combox placed in a grid Pin
infotools16-Nov-07 19:04
infotools16-Nov-07 19:04 
AnswerRe: Handling Valuemember of Combox placed in a grid Pin
deathbat20-Nov-07 13:37
deathbat20-Nov-07 13:37 
GeneralRe: Handling Valuemember of Combox placed in a grid Pin
infotools23-Nov-07 22:26
infotools23-Nov-07 22:26 
QuestionReassigning a control's parent Pin
The ANZAC16-Nov-07 18:45
The ANZAC16-Nov-07 18:45 
AnswerRe: Reassigning a control's parent Pin
Christian Graus16-Nov-07 20:28
protectorChristian Graus16-Nov-07 20:28 
QuestionConnecting to SQL Pin
tellytub16-Nov-07 17:58
tellytub16-Nov-07 17:58 
AnswerRe: Connecting to SQL Pin
Abhijit Jana16-Nov-07 21:31
professionalAbhijit Jana16-Nov-07 21:31 
Questionsaving table Pin
cj433116-Nov-07 10:29
cj433116-Nov-07 10:29 
AnswerRe: saving table Pin
cj433119-Nov-07 9:59
cj433119-Nov-07 9:59 
QuestionRetriving source code from a exe file which was developed in visual basic 6 Pin
S.Haris16-Nov-07 9:45
S.Haris16-Nov-07 9:45 
AnswerRe: Retriving source code from a exe file which was developed in visual basic 6 Pin
DigiOz Multimedia16-Nov-07 15:33
DigiOz Multimedia16-Nov-07 15:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.