|
Hi
I am opening my VC++6.0 application in VS2008 and getting the above error. what setting needs to be done for this to port this application in VS2008.
Also if I am porting this application to VS2008, will it work in Visual Studio Pro 2010?
SNI
|
|
|
|
|
SNI wrote: I am opening my VC++6.0 application in VS2008 and getting the above error. what
setting needs to be done for this to port this application in VS2008.
Have you tried this?
SNI wrote: Also if I am porting this application to VS2008, will it work in Visual Studio Pro 2010?
Possibly, but much like porting from VS6 to VS2008, you may encounter conversion problems, though they may be fewer.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Hello,
In Visual Studio, while creating MFC application, we got Runtime Library setting in C\C++ node in Project Propery Dialog. It have different options, what is exact meaning of these.
|
|
|
|
|
Take a look at the options offered. In my system I have the following options:
- Multi-threaded : a static library that supports threading
- Multi-threaded Debug : as above, that includes debug information
- Multi-threaded DLL : a dynamic library that supports threading
- Multi-threaded Debug DLL : as above, that includes debug information
These are versions of the C/C++ basic runtime libraries, and are purely to support the language. You add extra libraries to your project to support Win32 and MFC/ATL as required. Note that most required libraries are added to your project when it is created by the New Project wizard in Visual Studio.
The best things in life are not things.
|
|
|
|
|
Hello All,
I am C++/MFC devloper. I have been working with dll/com/mfc from few years now, but I always have confusion, what is exact diffrence in Static,Dynamic,Shared library. Moreover when I use shared library it creates lib file and then I link with lib file to reuse source code.
My assumption about 'lib vs dll' was like '.h vs .cpp'. Is my assumption correct?
Wherever I work with multiple project I got huge number of linker errors.
Happy Programming.
|
|
|
|
|
Pranit Kothari wrote: what is exact diffrence in Static,Dynamic,Shared library You may find some useful information at Library (computing) page at Wikipedia[^].
Pranit Kothari wrote: My assumption about 'lib vs dll' was like '.h vs .cpp'. Is my assumption correct? It is a good analogy.
Pranit Kothari wrote: Wherever I work with multiple project I got huge number of linker errors. That's a practical problem that might be solved if you post the exact error message here.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
I've to set the 'Loudness Equalization' property of the speakers to true. I'm referring to the MSDN DOC file (Vista_SysFX.Doc) from here[^]. But the compiler give error for CreateAudioMediaType() function saying it requires 3 parameter (prototype
STDAPI CreateAudioMediaType(const WAVEFORMATEX* pAudioFormat, UINT32 cbAudioFormatSize, IAudioMediaType** ppIAudioMediaType) ).
But when I follow this prototype, it gives me linker error for this function. Is there any SDK mismatch or version mismatch in DLLs?
Or is there any other alternative API to set the system speakers 'Loudness Equalization' property.
Thanks in advance.
|
|
|
|
|
Malli_S wrote: it gives me linker error for this function.
I'm guessing at what your error is since you did not add the details here. Have you included the required library in your project as detailed here[^]?
The best things in life are not things.
|
|
|
|
|
Yes, I tried that.
The funniest part is any of the files (Mtype.h or Streams.h) isn't found when included, neither the lib. But when I change the function for 3 parameter, it gets compiled and fails to link. Even I was wondering about this prototype mismatch.
|
|
|
|
|
Malli_S wrote: fails to link.
Well you mentioned that already, but you still have not posted any error messages which might help us to help you.
The best things in life are not things.
|
|
|
|
|
for this
hr = CreateAudioMediaType(&wfx.Format, &pAMTOut);
I get this error :
error C2660: 'CreateAudioMediaType' : function does not take 2 arguments
And when i change the code to this
hr = CreateAudioMediaType(&wfx.Format, wfx.Format.cbSize, &pAMTOut);
it gets compiled. But gives this linker error:
error LNK2019: unresolved external symbol _CreateAudioMediaType@12 referenced in function "void __cdecl useAPO(void)" (?useAPO@@YAXXZ)
|
|
|
|
|
Malli_S wrote: error C2660: 'CreateAudioMediaType' : function does not take 2 arguments
The doc is here[^], and the API takes 3 arguments. The last one is a BOOL, and you're passing the address of pAMTOut, which doesn't look cool.
Malli_S wrote: error LNK2019: unresolved external symbol _CreateAudioMediaType@12 referenced in function "void __cdecl useAPO(void)" (?useAPO@@YAXXZ)
The doc (again) says that you need to link to streambase.lib . If you aren't doing that, you should either change your project settings to link to it, or do it from your code:
#pragma comment(lib, "streambase.lib")
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Yes, the MSDN doc says the last parameter is BOOL. And when I googled, I found three different prototypes.
|
|
|
|
|
Malli_S wrote: Yes, the MSDN doc says the last parameter is BOOL. And when I googled, I found three different prototypes
I think it would be wise to go with what MSDN says.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
...and streambase.lib you have to build. It's in the sample code and has build configurations for debug and release.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Don't have to build it. It comes with Mobile SDK 5.0
But event that doesn't match with the prototype.
|
|
|
|
|
I gave you a link to the documentation, and a hint, in my first reply. Did you check that you have included the correct .lib file in your project settings?
The best things in life are not things.
|
|
|
|
|
Yes, gone through it. But I already had visited them. After having googled, I posted the question here.
Anyway, thanks for your efforts.
|
|
|
|
|
Malli_S wrote: Yes, gone through it.
And what was the result? You still have not shown any sample code to help us diagnose your problem.
The best things in life are not things.
|
|
|
|
|
I've posted the code in the earlier post.
|
|
|
|
|
Malli_S wrote: I've posted the code in the earlier post.
Wow, but this is hard work.
Please post the exact code that causes you a problem along with any and all error messages as they appear on your screen. Only then can we begin to make a guess at your problem and its resolution. Before doing this make sure that you are using the proper format of any function calls, including the correct parameters, according to both the MSDN documentation (see link I provided earlier) and the actual header files in the version of the SDK that you are using. Ensure that you have included all the correct libraries in your project properties, again in line with the MSDN documentation.
Please do not waste your or our time with one liners like the above which serve absolutely no purpose.
The best things in life are not things.
|
|
|
|
|

#include <objbase.h>
#include <audioenginebaseapo.h>
#include <stdio.h>
#include <stdlib.h>
#include <wmcodecdsp.h>
APO_CONNECTION_DESCRIPTOR inDesc = {
APO_CONNECTION_BUFFER_TYPE_EXTERNAL,
NULL,
0,
NULL,
APO_CONNECTION_DESCRIPTOR_SIGNATURE
}, *pInDesc = &inDesc,
outDesc = {
APO_CONNECTION_BUFFER_TYPE_EXTERNAL,
NULL,
0,
NULL,
APO_CONNECTION_DESCRIPTOR_SIGNATURE
}, *pOutDesc = &outDesc;
APO_CONNECTION_PROPERTY inConn = {
NULL,
0,
BUFFER_VALID,
APO_CONNECTION_PROPERTY_SIGNATURE
}, *pInConn = &inConn,
outConn = {
NULL,
0,
BUFFER_INVALID,
APO_CONNECTION_PROPERTY_SIGNATURE
}, *pOutConn = &outConn;
#define CHECKHR(x) hr = x; if (FAILED(hr)) {printf("%d: %08X\n", __LINE__, hr); goto exit;}
#define SET_I4(pkey,val) pv.vt = VT_I4; pv.lVal = val; CHECKHR(pPS->SetValue(pkey, &pv));
#define SET_BOOL(pkey,val) pv.vt = VT_BOOL; pv.boolVal = val ? VARIANT_TRUE : VARIANT_FALSE; CHECKHR(pPS->SetValue(pkey, &pv));
void useAPO()
{
IUnknown* pUnk = NULL;
IAudioProcessingObjectRT* pRT = NULL;
IAudioProcessingObjectConfiguration* pConfig = NULL;
IPropertyStore* pPS = NULL;
WAVEFORMATEXTENSIBLE wfx;
IAudioMediaType* pAMTIn = NULL, *pAMTOut = NULL;
PROPVARIANT pv;
HRESULT hr;
CHECKHR(CoCreateInstance(CLSID_CWMAudioLFXAPO, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&pUnk));
CHECKHR(pUnk->QueryInterface(__uuidof(IAudioProcessingObjectRT), (void**)&pRT));
CHECKHR(pUnk->QueryInterface(__uuidof(IAudioProcessingObjectConfiguration), (void**)&pConfig));
CHECKHR(pUnk->QueryInterface(IID_IPropertyStore, (void**)&pPS));
SET_I4(MFPKEY_CORR_MULTICHANNEL_MODE, 2);
SET_I4(MFPKEY_CORR_BASS_MANAGEMENT_MODE, 1);
SET_I4(MFPKEY_BASSMGMT_SPKRBASSCONFIG, 0);
SET_I4(MFPKEY_BASSMGMT_CROSSOVER_FREQ, 120);
SET_BOOL(MFPKEY_CORR_LOUDNESS_EQUALIZATION_ON, TRUE);
SET_BOOL(MFPKEY_BASSMGMT_BIGROOM, TRUE);
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfx.Format.nChannels = 2;
wfx.Format.nSamplesPerSec = 44100;
wfx.Format.wBitsPerSample = 32;
wfx.Format.nBlockAlign = wfx.Format.wBitsPerSample / 8 * wfx.Format.nChannels;
wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign;
wfx.Format.cbSize = 22;
wfx.Samples.wValidBitsPerSample = 32;
wfx.dwChannelMask = 3;
wfx.SubFormat.Data1 = WAVE_FORMAT_IEEE_FLOAT;
wfx.SubFormat.Data2 = 0x0000;
wfx.SubFormat.Data3 = 0x0010;
wfx.SubFormat.Data4[0] = 0x80;
wfx.SubFormat.Data4[1] = 0x00;
wfx.SubFormat.Data4[2] = 0x00;
wfx.SubFormat.Data4[3] = 0xaa;
wfx.SubFormat.Data4[4] = 0x00;
wfx.SubFormat.Data4[5] = 0x38;
wfx.SubFormat.Data4[6] = 0x9b;
wfx.SubFormat.Data4[7] = 0x71;
CHECKHR(CreateAudioMediaType(&wfx.Format, &pAMTIn));
wfx.Format.nChannels = 6;
wfx.Format.nBlockAlign = wfx.Format.wBitsPerSample / 8 * wfx.Format.nChannels;
wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign;
wfx.dwChannelMask = 0x3f;
CHECKHR(CreateAudioMediaType(&wfx.Format, &pAMTOut));
pInDesc->pFormat = pAMTIn;
pOutDesc->pFormat = pAMTOut;
CHECKHR(pConfig->LockForProcess(1, &pInDesc, 1, &pOutDesc));
while (0)
{
pInConn->u32ValidFrameCount = 0;
pInConn->pBuffer = 0;
pOutConn->pBuffer = 0;
pOutConn->u32BufferFlags = BUFFER_INVALID;
pRT->APOProcess(1, &pInConn, 1, &pOutConn);
}
pConfig->UnlockForProcess();
exit:
#define SAFE_RELEASE(p) if (p) p->Release();
SAFE_RELEASE(pAMTIn);
SAFE_RELEASE(pAMTOut);
SAFE_RELEASE(pUnk);
SAFE_RELEASE(pRT);
SAFE_RELEASE(pConfig);
SAFE_RELEASE(pPS);
}
The above code gives compiler error for CreateAudioMediaType() function. The error is
error C2660: 'CreateAudioMediaType' : function does not take 2 arguments
When I modify these function calls to
hr = CreateAudioMediaType(&wfx.Format, wfx.Format.cbSize, &pAMTOut);
it gives linker error as :
error LNK2019: unresolved external symbol _CreateAudioMediaType@12 referenced in function "void __cdecl useAPO(void)" (?useAPO@@YAXXZ)
This is what all I have in my code. I hope now this will help.
Thanks in advance.
|
|
|
|
|
Malli_S wrote: The above code gives compiler error for CreateAudioMediaType() function. The error is
error C2660: 'CreateAudioMediaType' : function does not take 2 arguments
Well that's quite clear, your function call does not match the function prototype in the package header file. As far as I am able to ascertain the correct definition is as described in this page[^] in MSDN.
Malli_S wrote: error LNK2019: unresolved external symbol _CreateAudioMediaType@12 referenced in function "void __cdecl useAPO(void)" (?useAPO@@YAXXZ)
Again this message is quite clear; the function you are attempting to call exists in an external library that has not been included in your project. Unfortunately the documentation for the CreateAudioMediaType() function does not indicate which library you need to include in your project. You could try checking the header file to see if it gives any information there. Unfortunately these functions appear to be part of the Windows Driver Kit, and I do not have a copy so am unable to offer any further suggestions.
You may like to recheck the documentation you are working from, or try posting on one of the Microsoft technical forums.
The best things in life are not things.
|
|
|
|
|
Yes, I already had tried this all and then posted it here. But still thanks for your great efforts.
|
|
|
|
|