Hi all,
It has been pointed out that I forgot
to add gdi32.lib to the list of libs for this Tutorial
Apologies..
Also I also think #include "resource.h"
should come first in the list of includes and not last as I seem to have them.
Snoopy.
Sound Recorder using the low level Windows API in C++ Recorder with wave visualisation
#17
Posted 14 November 2012 - 03:43 PM
Hi Snoopy, i was having problems creating the VC++ project. Can you upload a rar/zip file with the entire solution? Thanks for your help!
#18
Posted 01 February 2013 - 10:34 AM
can you please place the compiled source code in a compressed file. I am having alot of errors . Also how to include Winmm.lib ? Thanks
#19
Posted 01 February 2013 - 10:45 AM
I am getting these errors . please help me to resolve these.
<code>
Error 1 error C2440: '=' : cannot convert from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 65 1 test
Error 2 error C2440: '=' : cannot convert from 'const char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 76 1 test
Error 3 error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 121 1 test
Error 4 error C2664: 'CreateWindowExW' : cannot convert parameter 3 from 'const char [7]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 209 1 test
Error 5 error C2664: 'CreateWindowExW' : cannot convert parameter 3 from 'const char [5]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 211 1 test
Error 6 error C2664: 'CreateWindowExW' : cannot convert parameter 3 from 'const char [5]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 213 1 test
Error 7 error C2664: 'MessageBoxW' : cannot convert parameter 3 from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 401 1 test
Error 8 error C2440: '=' : cannot convert from 'const char [25]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 574 1 test
Error 9 error C2440: '=' : cannot convert from 'char [260]' to 'LPWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 576 1 test
Error 10 error C2440: '=' : cannot convert from 'const char [4]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 582 1 test
Error 11 error C2664: 'MessageBoxW' : cannot convert parameter 3 from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 652 1 test
Error 12 error C2664: 'MessageBoxW' : cannot convert parameter 3 from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 804 1 test
Error 13 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [16]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 976 1 test
14 IntelliSense: a value of type "char *" cannot be assigned to an entity of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 65 25 test
15 IntelliSense: a value of type "const char *" cannot be assigned to an entity of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 76 24 test
16 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 99 16 test
17 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 101 16 test
18 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 209 21 test
19 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 211 21 test
20 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 213 21 test
21 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 399 43 test
22 IntelliSense: a value of type "const char *" cannot be assigned to an entity of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 574 29 test
23 IntelliSense: a value of type "char *" cannot be assigned to an entity of type "LPWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 576 27 test
24 IntelliSense: a value of type "const char *" cannot be assigned to an entity of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 582 29 test
25 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 650 47 test
26 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 802 48 test
27 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 976 26 test
28 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 976 61 test
</code>
<code>
Error 1 error C2440: '=' : cannot convert from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 65 1 test
Error 2 error C2440: '=' : cannot convert from 'const char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 76 1 test
Error 3 error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 121 1 test
Error 4 error C2664: 'CreateWindowExW' : cannot convert parameter 3 from 'const char [7]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 209 1 test
Error 5 error C2664: 'CreateWindowExW' : cannot convert parameter 3 from 'const char [5]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 211 1 test
Error 6 error C2664: 'CreateWindowExW' : cannot convert parameter 3 from 'const char [5]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 213 1 test
Error 7 error C2664: 'MessageBoxW' : cannot convert parameter 3 from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 401 1 test
Error 8 error C2440: '=' : cannot convert from 'const char [25]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 574 1 test
Error 9 error C2440: '=' : cannot convert from 'char [260]' to 'LPWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 576 1 test
Error 10 error C2440: '=' : cannot convert from 'const char [4]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 582 1 test
Error 11 error C2664: 'MessageBoxW' : cannot convert parameter 3 from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 652 1 test
Error 12 error C2664: 'MessageBoxW' : cannot convert parameter 3 from 'char [9]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 804 1 test
Error 13 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [16]' to 'LPCWSTR' c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 976 1 test
14 IntelliSense: a value of type "char *" cannot be assigned to an entity of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 65 25 test
15 IntelliSense: a value of type "const char *" cannot be assigned to an entity of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 76 24 test
16 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 99 16 test
17 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 101 16 test
18 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 209 21 test
19 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 211 21 test
20 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 213 21 test
21 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 399 43 test
22 IntelliSense: a value of type "const char *" cannot be assigned to an entity of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 574 29 test
23 IntelliSense: a value of type "char *" cannot be assigned to an entity of type "LPWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 576 27 test
24 IntelliSense: a value of type "const char *" cannot be assigned to an entity of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 582 29 test
25 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 650 47 test
26 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 802 48 test
27 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 976 26 test
28 IntelliSense: argument of type "const char *" is incompatible with parameter of type "LPCWSTR" c:\users\shahzeb\documents\visual studio 2010\projects\audio streaming\audio streaming\recorder.cpp 976 61 test
</code>
#20
Posted 03 February 2013 - 02:34 AM
Hi,
You are building this as a unicode build
this is not a Unicode build.
You need to change your charcter set to Multi-Byte
Snoopy.
You are building this as a unicode build
this is not a Unicode build.
You need to change your charcter set to Multi-Byte
Snoopy.
#21
Posted 03 February 2013 - 02:43 AM
Hi Snoopy,
Thanks for your help . I figured out the problem myself. the code helped me alot.
Thanks for your help . I figured out the problem myself. the code helped me alot.
#22
Posted Yesterday, 06:45 AM
Hello snoopy11!
I have done exactly what you have asked us to,but there seems to be a problem
I've put the error below and I was hoping if you could help me figure it out.I dont have much experience at c++,and I would appreciate it if you could help me 
[1>------ Build started: Project: window, Configuration: Debug Win32 ------
1>Build started 19-May-13 3:34:25 PM.
1>InitializeBuildStatus:
1> Touching "Debug\window.unsuccessfulbuild".
1>ClCompile:
1> recorder.cpp
1> jkhbou.cpp
1>c:\users\user\desktop\window\window\jkhbou.cpp(195): error C2601: 'readSample' : local function definitions are illegal
1> c:\users\user\desktop\window\window\jkhbou.cpp(121): this line contains a '{' which has not yet been matched
1>c:\users\user\desktop\window\window\jkhbou.cpp(240): error C2601: 'Wav' : local function definitions are illegal
1> c:\users\user\desktop\window\window\jkhbou.cpp(121): this line contains a '{' which has not yet been matched
1>c:\users\user\desktop\window\window\jkhbou.cpp(386): error C2143: syntax error : missing ';' before 'case'
1>c:\users\user\desktop\window\window\jkhbou.cpp(573): error C2601: 'SaveWavFile' : local function definitions are illegal
1> c:\users\user\desktop\window\window\jkhbou.cpp(121): this line contains a '{' which has not yet been matched
1>c:\users\user\desktop\window\window\jkhbou.cpp(611): fatal error C1075: end of file found before the left brace '{' at 'c:\users\user\desktop\window\window\jkhbou.cpp(121)' was matched
1> Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:02.57
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========]
I have done exactly what you have asked us to,but there seems to be a problem
[1>------ Build started: Project: window, Configuration: Debug Win32 ------
1>Build started 19-May-13 3:34:25 PM.
1>InitializeBuildStatus:
1> Touching "Debug\window.unsuccessfulbuild".
1>ClCompile:
1> recorder.cpp
1> jkhbou.cpp
1>c:\users\user\desktop\window\window\jkhbou.cpp(195): error C2601: 'readSample' : local function definitions are illegal
1> c:\users\user\desktop\window\window\jkhbou.cpp(121): this line contains a '{' which has not yet been matched
1>c:\users\user\desktop\window\window\jkhbou.cpp(240): error C2601: 'Wav' : local function definitions are illegal
1> c:\users\user\desktop\window\window\jkhbou.cpp(121): this line contains a '{' which has not yet been matched
1>c:\users\user\desktop\window\window\jkhbou.cpp(386): error C2143: syntax error : missing ';' before 'case'
1>c:\users\user\desktop\window\window\jkhbou.cpp(573): error C2601: 'SaveWavFile' : local function definitions are illegal
1> c:\users\user\desktop\window\window\jkhbou.cpp(121): this line contains a '{' which has not yet been matched
1>c:\users\user\desktop\window\window\jkhbou.cpp(611): fatal error C1075: end of file found before the left brace '{' at 'c:\users\user\desktop\window\window\jkhbou.cpp(121)' was matched
1> Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:02.57
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========]
#23
Posted Yesterday, 09:36 AM
It seems like you have not copied the code
correctly and you have missing braces...
please post your code and I will take a look.
Regards
Snoopy.
correctly and you have missing braces...
please post your code and I will take a look.
Regards
Snoopy.
|
|






MultiQuote



|