- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to write a program that can access a video device (e.g .a webcam). That means calling functions in vfw.h. Is there an interface module?
For example, the line:
case (ID_FILE_VIDEOCAPTURE)
hWndC=capCreateCaptureWindow('My Capture Window'C, IOR(WS_CHILD,WS_VISIBLE), 0, 0, 160, 120, ghwndClient, nID)
gives an unresolved external symbol error.
I have tried various USE statements to no avail e.g. USE IFWINTY and USE IFPORT
Thanks,
NickS
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Avicap32/Vfw does not exist in the Fortran include modules. You will need to create your own interfaces.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!
I am wondering how one finds out which modules to use for which functions other than just trying - or wading through the modules themselves.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's an interface to this routine - you may need others. You'll want to USE this module, add to it as needed.
module Vfw32
use IFWINTY
implicit none
interface
function capCreateCaptureWindow (lpszWindowName, dwStyle, x, y, nWidth, &
& nHeight, hwndParent, nID) bind(C,name="capCreateCaptureWindowA")
import
!DIR$ ATTRIBUTES STDCALL :: capCreateCaptureWindow
integer(HANDLE) :: capCreateCaptureWindow
character, dimension(*), intent(IN) :: lpszWindowName
integer(DWORD), value, intent(IN) :: dwStyle
integer(DWORD), value, intent(IN) :: x, y, nWidth, nHeight
integer(HANDLE), value, intent(IN) :: hwndParent
integer(DWORD), value, intent(IN) :: nID
end function capCreateCaptureWindow
end interface
end module Vfw32
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much - most helpful. I'll also check for updates re. the next message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code example here has been passed to the proper group for further work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look up the documentation of the function on Microsoft's site. For example, capCreateCaptureWindowA function (vfw.h) - Win32 apps | Microsoft Docs
Towards the bottom of the page, look to see which Library it is defined in. For example:
Here we see it is in library Vfw32.lib. If Intel provides a module for this, it is the same as the library name, VFW32 in this case. But that module is not in the Intel set.
You can, of course, always search the compiler's Include folder for the name of the routine you want to see if there's a hit.
During my time at Intel, I did a LOT of work on the Windows API modules, updating some and creating some new ones when I saw requests. I don't recall ever seeing this library come up before. Creating and updating these modules is a lot of hard work, and Microsoft adds new APIs faster than I could add them to modules. Before I retired, I managed to get KERNEL32 mostly up to date, with changes in USER32 and some others.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Over the years I have come to appreciate the huge amount of work that must have gone into making so much of the Windows API accessible to Intel Fortran programmers. It has always been there when I needed it and it has enabled very many useful things (except until now - and I don't mind having to write a few interface routines having seen an example). Thanks so much - enjoy your retirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just realized that I messed up the module I created for you by omitting the value attribute where it was needed. I have edited the reply above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For what it's worth, this is a module I used when I did some video stuff a few years ago.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That could be very useful - I will try it.
Thanks,
Nick

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