- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to get more familiar with using COM in fortran. I build a project using the example on page 561 of the Intel Fortran Language Reference. It compiled fine. However, when I run the program nothing happens. I added two print statements for the variable status to determine what is going on. Once after call COMInitialize(status) and once after call COMGetActiveObjectByProgID(...). The print statement was zero(0) both times. I am using visual studio 2005. Any recommendation would be great appreciated.
Thanks,
! Test1.f90
!
! FUNCTIONS:
! Test1 - Entry point of console application.
!
!****************************************************************************
!
! PROGRAM: Test1
!
! PURPOSE: Entry point for the console application.
!
!****************************************************************************
program Test1use ifwinuse ifcomuse ifautoimplicit none! Variablesinteger(4) word_appinteger(4) statusinteger(4) invoke_args! Body of Test1call COMInitialize(status)print *, statuscall COMGetActiveObjectByProgID("Word.Application", word_app, status)print *, statusif(status >= 0)theninvoke_args = AutoAllocateInvokeArgs()
call AutoAddArg(invoke_args, "Copies", 2)status = AutoInvoke(word_app, "PrintOut", invoke_args)
call AutoDeallocateInvokeArgs(invoke_args)status = COMReleaseObject(word_app)
endifcall COMUninitialize() end program Test1
Link Copied

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