- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks
L
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
StringBuilder cname =
new StringBuilder(32);cname.Append(' ',cname.Capacity);
CsDllIntWrap.CSDLLCNAME( cname, cname.Length );
int isymcur=99;int isymtmp=0;int ndim=0;int ierr=0; int[,] isize = new int[2,2];StringBuilder cerr =
new StringBuilder(1024);cerr.Append(' ',cerr.Capacity);
int[] iary = {1,2,3,4};ra1_forptr ia =
new ra1_forptr();ia.baseaddr=0;
CsDllIntWrap.FORPTR(
ref ia);Console.WriteLine(ia.baseaddr);
Console.WriteLine(ia.elsize);
Console.WriteLine(ia.offset);
Console.WriteLine(ia.bdefined);
Console.WriteLine(ia.rank);
Console.WriteLine(ia.extent1);
Console.WriteLine(ia.stride1);
Console.WriteLine(ia.lbound1);
Console.ReadLine();
int ival;UInt32 iadr;
unsafe{
int* ip;iadr=ia.baseaddr + ia.offset;
ip = (
int*)(ia.baseaddr + ia.offset); // point to first elementival = *ip;
Console.WriteLine(iadr);
}
Console.WriteLine(ival);
Console.ReadLine();
CsDllIntWrap.CSDLLINT( cname, cname.Length
,
ref isymcur,ref isymtmp,ref ndim,isize
,
ref ierr,cerr, cerr.Length);
Console.WriteLine(isymcur);
Console.WriteLine(isize[0,0]);
Console.WriteLine(isize[1,1]);
Console.WriteLine(cerr);
Console.ReadLine();
}
}
[StructLayout(LayoutKind.Sequential)]
public struct ra1_forptr{ public UInt32 baseaddr; public Int32 elsize; public UInt32 offset; public Int32 bdefined; public Int32 rank; public Int32 extent1; public Int32 stride1; public Int32 lbound1;}
public class CsDllIntWrap{
[DllImport("CSDLLINT.dll")]
public static extern void FORPTR( ref ra1_forptr iary);
[DllImport("CSDLLINT.dll")]
public static extern void CSDLLCNAME(StringBuilder cname, int len_cname );[DllImport("CSDLLINT.dll")]
public static extern void CSDLLINT(StringBuilder cname, int len_cname,
ref int isymcur, ref int isymtyp, ref int ndim, [MarshalAs(UnmanagedType.LPArray)]
int[,] isize,
ref int ierr,StringBuilder cerr,
int len_cerr);}
----------------- Fortran ------------------!
! FUNCTIONS/SUBROUTINES exported from CSDLLINT.dll:
! CSDLLINT - subroutine
!
!DEC$ ATTRIBUTES DLLEXPORT::FORPTR
save
integer,pointer :: iary(:)
integer, allocatable, target :: iary1(:)
iary1=7
end
subroutine CSDLLINT(cname,isymcur,isymtyp,ndim,isize,ierr,cerr)
!
!DEC$ ATTRIBUTES DLLEXPORT::CSDLLINT
integer :: isymcur
integer :: isymtyp
integer :: ndim
integer :: isize(0:4)
integer :: ierr
character(len=*) :: cerr
cname=cx
isymtyp=2
ndim=3
isize(:)=4
ierr=5
cerr='Just a test'
print*,i,ichar(cname(i:i))
enddo
print*,len(cname),ichar(cname(30:30)),ichar(cname(31:31)),ichar(cname(32:32))
cname=cx
return
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the best approach to output to the GUI several seperate lines? Can you get the editcontrol box (or whatever works) to display on seperate lines without creating a seperate box for each line? thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Result x = X
result y = Y
....
...
..
The results to display could be longer than just "X & Y" if the user initially selected to calculate "A - Z". The results of the calculation are read-only to the user. The outputs from the calculation are reals and integers that are each converted to character strings for output to the GUI.
THANKS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SUBROUTINE CONSOLEDISPLAY(CHECKED) !***************************************************************************** !* * !* CALBACK SUBROUTINE TO BRING UP A DIALOG BOX TO DISPLAY THE CONTENTS OF THE* !* CONSOLE LOG FILE IN A LIST BOX * !***************************************************************************** USE DFLIB USE DFLOGM IMPLICIT NONE INCLUDE 'RESOURCE.FD' TYPE(DIALOG)DLG COMMON/CONSOLE/CONSOLEFILE CHARACTER($MAXPATH) CONSOLEFILE LOGICAL(KIND=4)RET INTEGER(KIND=4)IRET, I CHARACTER(LEN=130)CTEMP1 LOGICAL(KIND=4)CHECKED CALL UNUSEDQQ(CHECKED) !* INITIALIZE THE DIALOG BOX RET = DLGINIT(IDD_SHOWCONSOLE, DLG) RET = DLGSET(DLG, IDC_LIST_CONSOLE,250,DLG_NUMITEMS) OPEN(UNIT=200,FILE=CONSOLEFILE,STATUS='OLD', ERR=1000) I = 1 DO WHILE (.NOT. EOF(200)) READ(200,'(A130)')CTEMP1 I = I+1 RET = DLGSET(DLG, IDC_LIST_CONSOLE,CTEMP1,I) ! IF I EXCEEDS DLG_NUMITEMS, DLG_NUMITEMS IS AUTOMATICALLY INCREASED... END DO !* BRING UP THE DIALOG BOX IRET = DLGMODAL(DLG) !* EXIT BUTTON IF(IRET == IDC_CONSOLE_EXIT)THEN !* DESTROY AND RELEASE THE DIALOG RESOURCES CALL DLGUNINIT(DLG) ENDIF GO TO 999 1000 CONTINUE IRET = MESSAGEBOXQQ('ERROR OPENING CONSOLE LOG FILE'C,'ERROR'C,MB$ICONSTOP .OR. MB$OK) 999 CONTINUE REWIND(UNIT=200) CLOSE(UNIT=200) RETURN END SUBROUTINE CONSOLEDISPLAY

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page