Solved

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

Posted on 2006-06-23
3
631 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:salsipius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 16970670
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?
0
 

Author Comment

by:salsipius
ID: 16970893
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.
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 500 total points
ID: 16979822
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
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question