Need Help using avifil32 API (Project Setup in VS.net)

Hello Experts,

I need some help setting up a project and Using the Video for Windows and avifil32 API.

I have some samples from msdn VS6 SDK Examples and I think I know how the code works and what I need to do, but I can't seem to get my project to compile without errors.

I open the sample from msdn and as you would imagine it builds and runs fine. I copy the project make a few changes and it's still ok. However as soon as I make a new project (like a dll proj) I get anywhere from 12 to 150 errors.

I am sure that it is a simple matter of project settings as I havent changed the code at all when it fails but I just can't see where I am going wrong.

Could someone please outline for me how to make a simple Win32 (unmanaged)  DLL in VS.net that uses vfw.h and avifil32.dll . I would like to make a DLL so my VB app can use these functions. I also know I can use the vaifil32.dll directly in VB but I would rather use it in C++ to help keep my project organized

Thanks in Advance, I really need to get this working

J
salsipiusAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AlexFMCommented:
Well, the way is straightforward:
Create new project of required type (Dll, exe etc.).
Add required lib files to Linker dependency list.
Include SDK h-files to project source file.
Call required functions.

What errors exactly do you have?
salsipiusAuthor Commented:
Thanks for the comments, I think my problem is in the Lib linking, I am not sure how to do this and can't seen to fin any examples.
I need to use avifil32.dll how do I do this?

Sorry For the long string of things but here are the errors

Compiling...
WRITEAVI.C
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(30) : error C2040: 'LPSTR' : 'unsigned long ' differs in levels of indirection from 'char *'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(31) : error C2040: 'LPVOID' : 'unsigned long ' differs in levels of indirection from 'void *'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(32) : error C2040: 'LPCSTR' : 'unsigned long ' differs in levels of indirection from 'const char *'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(33) : error C2040: 'LPCWSTR' : 'unsigned long ' differs in levels of indirection from 'const unsigned short *'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(34) : warning C4142: benign redefinition of type
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(35) : warning C4142: benign redefinition of type
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(36) : warning C4142: benign redefinition of type
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(38) : warning C4142: benign redefinition of type
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(302) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(302) : error C2085: 'CloseDriver' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(303) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(304) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(304) : error C2085: 'SendDriverMessage' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(305) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(306) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(306) : error C2085: 'GetDriverModuleHandle' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(307) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(393) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(393) : error C2085: 'sndPlaySoundA' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(394) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(439) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(439) : error C2085: 'PlaySoundA' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(440) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(524) : error C2061: syntax error : identifier 'MMVERSION'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(530) : error C2059: syntax error : '}'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(534) : error C2061: syntax error : identifier 'MMVERSION'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(535) : error C2371: 'szPname' : redefinition; different basic types
        c:\program files\microsoft visual studio\vc98\include\mmsystem.h(525) : see declaration of 'szPname'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(540) : error C2059: syntax error : '}'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(547) : error C2061: syntax error : identifier 'WAVEOUTCAPS'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(547) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(548) : error C2061: syntax error : identifier 'PWAVEOUTCAPS'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(548) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(549) : error C2061: syntax error : identifier 'NPWAVEOUTCAPS'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(549) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(550) : error C2061: syntax error : identifier 'LPWAVEOUTCAPS'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(550) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(580) : error C2061: syntax error : identifier 'MMVERSION'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(585) : error C2059: syntax error : '}'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(589) : error C2061: syntax error : identifier 'MMVERSION'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(590) : error C2371: 'szPname' : redefinition; different basic types
        c:\program files\microsoft visual studio\vc98\include\mmsystem.h(525) : see declaration of 'szPname'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(594) : error C2059: syntax error : '}'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(601) : error C2061: syntax error : identifier 'WAVEINCAPS'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(601) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(602) : error C2061: syntax error : identifier 'PWAVEINCAPS'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(602) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(603) : error C2061: syntax error : identifier 'NPWAVEINCAPS'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(603) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(604) : error C2061: syntax error : identifier 'LPWAVEINCAPS'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(604) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(675) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(675) : error C2085: 'waveOutGetNumDevs' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(679) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(680) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(680) : error C2146: syntax error : missing ')' before identifier 'pwoc'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(680) : error C2081: 'LPWAVEOUTCAPSW' : name in formal parameter list illegal
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(680) : error C2085: 'waveOutGetDevCapsW' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(680) : error C2146: syntax error : missing ',' before identifier 'pwoc'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(680) : error C2059: syntax error : 'type'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(680) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(692) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(692) : error C2085: 'waveOutGetVolume' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(693) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(701) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(701) : error C2085: 'waveOutGetErrorTextA' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(702) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(713) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(714) : error C2085: 'waveOutOpen' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(716) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(717) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(717) : error C2085: 'waveOutPrepareHeader' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(718) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(719) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(719) : error C2085: 'waveOutWrite' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(720) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(721) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(721) : error C2085: 'waveOutRestart' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(722) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(723) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(723) : error C2085: 'waveOutBreakLoop' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(724) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(725) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(725) : error C2085: 'waveOutGetPitch' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(726) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(727) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(727) : error C2085: 'waveOutGetPlaybackRate' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(728) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(729) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(729) : error C2085: 'waveOutGetID' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(733) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(739) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(739) : error C2085: 'waveInGetNumDevs' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(743) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(744) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(744) : error C2146: syntax error : missing ')' before identifier 'pwic'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(744) : error C2081: 'LPWAVEINCAPSW' : name in formal parameter list illegal
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(744) : error C2085: 'waveInGetDevCapsW' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(744) : error C2146: syntax error : missing ',' before identifier 'pwic'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(744) : error C2059: syntax error : 'type'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(744) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(757) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(757) : error C2085: 'waveInGetErrorTextA' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(758) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(769) : error C2054: expected '(' to follow 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(770) : error C2085: 'waveInOpen' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(772) : error C2061: syntax error : identifier 'WINMMAPI'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(772) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\WRITEAVI.SBR': No such file or directory
Error executing bscmake.exe.
DanRollinsCommented:
If you have a project that works without error, the you are halfway home.  Just compare the settings of the working project to the one that is failing.  You will probably see different "include search path" or missing library files, etc.

What I do:  
1) Make a workspace with both projects
2) Open the Project Settings page for the one that works.
3) Get to (for instance) the C/C++ settings
4) Now click on the other project.  CLick back and forth to see differences

Altnerative to #4:  
Go to the "Project Options" box (C/C++) and copy it to the clipboard and paste it into an empty text editor.  Do the same for the other prokject.  By viewing the options in text, one next to the other, the differences usually become quite obvious.

-- Dan

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual C++.NET

From novice to tech pro — start learning today.