Click here to Skip to main content
15,896,154 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVC, Linker Tools Warning LNK4086 Pin
refla15-Apr-11 13:22
refla15-Apr-11 13:22 
AnswerRe: VC, Linker Tools Warning LNK4086 Pin
Hans Dietrich15-Apr-11 18:55
mentorHans Dietrich15-Apr-11 18:55 
GeneralRe: VC, Linker Tools Warning LNK4086 Pin
refla17-Apr-11 1:31
refla17-Apr-11 1:31 
AnswerRe: VC, Linker Tools Warning LNK4086 Pin
Hans Dietrich17-Apr-11 1:35
mentorHans Dietrich17-Apr-11 1:35 
GeneralRe: VC, Linker Tools Warning LNK4086 Pin
refla17-Apr-11 2:09
refla17-Apr-11 2:09 
AnswerRe: VC, Linker Tools Warning LNK4086 Pin
Hans Dietrich17-Apr-11 2:30
mentorHans Dietrich17-Apr-11 2:30 
GeneralRe: VC, Linker Tools Warning LNK4086 Pin
refla18-Apr-11 10:44
refla18-Apr-11 10:44 
QuestionBuild Error - Creating a DirectSound secondary buffer [modified] Pin
Paul Hasler15-Apr-11 4:44
Paul Hasler15-Apr-11 4:44 
The following code results in a Build Error error LNK2001: unresolved external symbol _IID_IDirectSoundBuffer8 if I un-comment the 5th line:
hr = pDirectSoundBuffer->QueryInterface(IID_IDirectSoundBuffer8, (LPVOID*) ppDirectSoundBufferInterface);

I've added Dsound.lib to the Additional Dependencies for the Linker in this project.
I've included Dsound.h which has the definition of IID_IDirectSoundBuffer8 in my .cpp file, so it should know all about the GUID Definition. Confused | :confused:

Why has it pre-pended an underscore in the Build Error message (i.e. "_IID_IDirectSoundBuffer8")? I don't have one in my code. I used "IID_IDirectSoundBuffer8".
// Create the buffer
hr = lpDirectSound->CreateSoundBuffer(&dsbDescription, &pDirectSoundBuffer, NULL);
if(SUCCEEDED(hr))
{
    //hr = pDirectSoundBuffer->QueryInterface(IID_IDirectSoundBuffer8, (LPVOID*) ppDirectSoundBufferInterface);
    pDirectSoundBuffer->Release();
}

With the offending line commented out as above, the code builds ok and runs. Putting in a break-point and investigating the various values just prior to the offending line I have the following:

hr = S_OK ......So it apparently created the Secondary Buffer Ok

pDirectSoundBuffer.IUnknown.__vfptr[0] = 0x73f5d348
pDirectSoundBuffer.IUnknown.__vfptr[1] = 0x73f38f8c
pDirectSoundBuffer.IUnknown.__vfptr[2] = 0x73f19105

dsbDescription.dwSize = 36
dsbDescription.Flags = 32960 (i.e. DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS)
dsbDescription.dwBufferBytes = 5930
dsbDescription.dwReserved = 0
dsbDescription.lpwfxFormat.wFormatTag = 1
dsbDescription.lpwfxFormat.nChannels = 1
dsbDescription.lpwfxFormat.nSamplesPerSec = 11025
dsbDescription.lpwfxFormat.nAvgBytesPerSec = 11025
dsbDescription.lpwfxFormat.nBlockAlign = 1
dsbDescription.lpwfxFormat.wBitsPerSample = 8
dsbDescription.lpwfxFormat.cbSize = 0
dsbDescription.guid3DAlgorithm = {GUID_NULL}

All values in dsbDescription correlate with what we should see for the selected Wave file.

The QueryInterface method is supposed to retrieve a pointer to the interface for my object.
i.e. it's supposed to fill the pointer ppDirectSoundBufferInterface with the correct pointer address for the DirectSound Buffer Interface of my new DirectSoundBuffer object.

Any clues at to why this Build Error occurs would be most appreciated.
Thank you in advance

Paul.
modified on Friday, April 15, 2011 11:25 AM

AnswerRe: Build Error - Creating a DirectSound secondary buffer Pin
Richard MacCutchan15-Apr-11 5:06
mveRichard MacCutchan15-Apr-11 5:06 
GeneralRe: Build Error - Creating a DirectSound secondary buffer Pin
Paul Hasler15-Apr-11 5:19
Paul Hasler15-Apr-11 5:19 
GeneralRe: Build Error - Creating a DirectSound secondary buffer Pin
Richard MacCutchan15-Apr-11 6:01
mveRichard MacCutchan15-Apr-11 6:01 
GeneralRe: Build Error - Creating a DirectSound secondary buffer Pin
Paul Hasler15-Apr-11 6:48
Paul Hasler15-Apr-11 6:48 
GeneralRe: Build Error - Creating a DirectSound secondary buffer Pin
Richard MacCutchan15-Apr-11 7:26
mveRichard MacCutchan15-Apr-11 7:26 
QuestionMultiple selection in CListCtrl?? Pin
Arrin15-Apr-11 0:29
Arrin15-Apr-11 0:29 
AnswerRe: Multiple selection in CListCtrl?? Pin
Hans Dietrich15-Apr-11 5:13
mentorHans Dietrich15-Apr-11 5:13 
GeneralRe: Multiple selection in CListCtrl?? Pin
Arrin6-May-11 0:35
Arrin6-May-11 0:35 
QuestionGrid Control allow to add any other control Pin
James Duy Trinh (VietDoor)14-Apr-11 20:39
James Duy Trinh (VietDoor)14-Apr-11 20:39 
AnswerRe: Grid Control allow to add any other control Pin
వేంకటనారాయణ(venkatmakam)14-Apr-11 21:31
వేంకటనారాయణ(venkatmakam)14-Apr-11 21:31 
AnswerRe: Grid Control allow to add any other control Pin
Code-o-mat14-Apr-11 22:43
Code-o-mat14-Apr-11 22:43 
QuestionQt - What do we mean by those code snippets [modified] Pin
Abder_Rahman14-Apr-11 1:37
Abder_Rahman14-Apr-11 1:37 
AnswerRe: Qt - What do we mean by those code snippets Pin
MicroVirus14-Apr-11 1:50
MicroVirus14-Apr-11 1:50 
GeneralRe: Qt - What do we mean by those code snippets [modified] Pin
Abder_Rahman14-Apr-11 1:55
Abder_Rahman14-Apr-11 1:55 
GeneralRe: Qt - What do we mean by those code snippets Pin
MicroVirus14-Apr-11 2:18
MicroVirus14-Apr-11 2:18 
GeneralRe: Qt - What do we mean by those code snippets Pin
Abder_Rahman14-Apr-11 22:21
Abder_Rahman14-Apr-11 22:21 
GeneralRe: Qt - What do we mean by those code snippets Pin
MicroVirus15-Apr-11 0:32
MicroVirus15-Apr-11 0:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.