News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

vfw32.dll has now become msvfw.32.dll!...

Started by AkinforASM, December 08, 2006, 07:06:40 AM

Previous topic - Next topic

AkinforASM

Dear Friends,

I'm making experiments with MASM by trying everything I'm capable of doing with delphi.

Recently I have found a webcam example (in FASM) and become curious if I can do it in MASM.

However when I add "include vfw32.inc" statement and compile/build and run the application. The application gave the error that it cannot load vfw32.dll (which is msvfw32.dll in XP).

Since I have no idea how external (i.e. imported) functions of a dll are defined in MASM I could not fix the problem.

My question is how I shall make the above mentioned include file point to msvfw32.dll and if I ever need to define a function contained in a dll, how can I do it?

Regards

Note: In delphi I can define any external function by using function afunction(params, params);stdcall;external 'nameofthedll.dll' syntax. I need no defines or any other file. If dll file is available it simply loads that function. But I failed to figure out how the same operation is performed in MASM.

sinsi

Have you tried including and linking (VFW.H converted to a .INC) and VFW32.LIB from the XP Platform SDK?
The .LIB seems to point to functions in MSVFW32.DLL and not VFW32.DLL as the MASM32 .LIB does.
Light travels faster than sound, that's why some people seem bright until you hear them.

Siekmanski

 Hi AkinforASM

Here's a vfw32.lib for you that works and a webcam example ..

Siekmanski

[attachment deleted by admin]

MichaelW

The Vfw32.lib from the PSDK imports from MSVFW32.dll, AVIFIL32.dll, and AVICAP32.dll. For the MASM32 Vfw32.lib I can't tell, but the webcam app that Scronty posted here uses the MASM32 Vfw32.lib, and imports two functions from AVICAP32.dll, and there is no AVICAP32.lib included.

Nope, after I make the changes necessary to build the app it tries to import from VFW32.dll, which is not available on my Windows 2000 system. But if I substitute the the Vfw32.lib from the PSDK, then it imports two functions from AVICAP32.dll, and runs OK (AFAICT without a webcam).
eschew obfuscation

AkinforASM

Thank you very much for the example and all the feedback. Now I can play with it better :U....

However, I still cannot understand how I shall declare functions of ready-made dlls. I mean at any rate I seem to need an .inc and .lib file for defining external functions. Is there a tutorial for that?

Regards

MichaelW

After researching this a bit, there appears to be no easy method of creating an import library like the Vfw32.lib from the PSDK, that imports (or perhaps the term should be exports) functions from more than one DLL. To create an import library that imports functions from one DLL, you can use the MASM32 include file to IMPORT library creator. The apps posted by Scronty and Siekmanski both use only two of the AVICAP32.dll functions from Vfw32.lib, so you could replace Vfw32.lib with an import library for AVICAP32.dll.

This include file prototypes only the two necessary functions (these are the only exported functions that are common to all versions of the DLL):

capCreateCaptureWindowA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
capCreateCaptureWindow equ <capCreateCaptureWindowA>
capGetDriverDescriptionA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
capGetDriverDescription equ <capGetDriverDescriptionA>


This batch file builds the import library:

\masm32\tools\inc2l\inc2l avicap32.inc
pause


The avicap32 include file and import library can be used to replace Vfw32 include file and import library for both of the apps, and the apps should build and run as before.
eschew obfuscation

AkinforASM

Quote from: MichaelW on December 09, 2006, 10:05:43 AM

capCreateCaptureWindowA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
capCreateCaptureWindow equ <capCreateCaptureWindowA>
capGetDriverDescriptionA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
capGetDriverDescription equ <capGetDriverDescriptionA>


This batch file builds the import library:

\masm32\tools\inc2l\inc2l avicap32.inc
pause


Thank you for the input. It seems that I'm learning much more by looking at the source code than coding myself.  :bg