DirectShow with WindowForms

Hello, I tryed the example fromhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/gettingstarted.asp as an console application and everything was fine.

But now I create it as WindowsForms project with VS 2005 Pro. I added a button to Form1, which executes the samplecode. I changed in the code the "printf" in MessageBox, included <dshow.h> and linked strmiids.lib, but i get the following errorcode(sorry its in german):

1>Kompilieren...

1>hallo.cpp

1>AssemblyInfo.cpp

1>Code wird generiert...

1>Verknüpfen...

1>hallo.obj : error LNK2028: Nicht aufgel?stes Token (0A00000E) ""extern "C" void __stdcall CoUninitialize(void)" (?CoUninitialize@@$$J10YGXXZ)", auf das in Funktion ""private: void __clrcall hallo::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@hallo@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)" verwiesen wird.

1>hallo.obj : error LNK2020: Nicht aufgel?stes Token (0A00000F) IID_IMediaEvent.

1>hallo.obj : error LNK2020: Nicht aufgel?stes Token (0A000010) IID_IMediaControl.

1>hallo.obj : error LNK2020: Nicht aufgel?stes Token (0A000011) CLSID_FilterGraph.

1>hallo.obj : error LNK2020: Nicht aufgel?stes Token (0A000012) IID_IGraphBuilder.

1>hallo.obj : error LNK2028: Nicht aufgel?stes Token (0A000013) ""extern "C" long __stdcall CoCreateInstance(struct _GUID const &,struct IUnknown *,unsigned long,struct _GUID const &,void * *)" (?CoCreateInstance@@$$J220YGJABU_GUID@@PAUIUnknown@@K0PAPAX@Z)", auf das in Funktion ""private: void __clrcall hallo::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@hallo@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)" verwiesen wird.

1>hallo.obj : error LNK2028: Nicht aufgel?stes Token (0A000015) ""extern "C" long __stdcall CoInitialize(void *)" (?CoInitialize@@$$J14YGJPAX@Z)", auf das in Funktion ""private: void __clrcall hallo::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@hallo@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)" verwiesen wird.

1>hallo.obj : error LNK2019: Verweis auf nicht aufgel?stes externes Symbol ""extern "C" void __stdcall CoUninitialize(void)" (?CoUninitialize@@$$J10YGXXZ)" in Funktion ""private: void __clrcall hallo::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@hallo@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)".

1>hallo.obj : error LNK2001: Nicht aufgel?stes externes Symbol "IID_IMediaEvent".

1>hallo.obj : error LNK2001: Nicht aufgel?stes externes Symbol "IID_IMediaControl".

1>hallo.obj : error LNK2019: Verweis auf nicht aufgel?stes externes Symbol ""extern "C" long __stdcall CoCreateInstance(struct _GUID const &,struct IUnknown *,unsigned long,struct _GUID const &,void * *)" (?CoCreateInstance@@$$J220YGJABU_GUID@@PAUIUnknown@@K0PAPAX@Z)" in Funktion ""private: void __clrcall hallo::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@hallo@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)".

1>hallo.obj : error LNK2001: Nicht aufgel?stes externes Symbol "IID_IGraphBuilder".

1>hallo.obj : error LNK2001: Nicht aufgel?stes externes Symbol "CLSID_FilterGraph".

1>hallo.obj : error LNK2019: Verweis auf nicht aufgel?stes externes Symbol ""extern "C" long __stdcall CoInitialize(void *)" (?CoInitialize@@$$J14YGJPAX@Z)" in Funktion ""private: void __clrcall hallo::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@hallo@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)".

1>C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2005\Projects\hallo\Debug\hallo.exe : fatal error LNK1120: 14 nicht aufgel?ste externe Verweise.

1>Das Buildprotokoll wurde unter "file://c:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2005\Projects\hallo\hallo\Debug\BuildLog.htm" gespeichert.

1>hallo - 15 Fehler, 0 Warnung(en)

========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ========

Please help.Thanks.

[5012 byte] By [ReneAlexander] at [2007-12-24]
# 1

I'm not sure why it is failing to find the symbols. Perhaps you could include your linker command line and output?

CoUninitialize is in ole32.lib and IID_IMediaEvent is in strmiids.lib. Perhaps you are pointing at an old copy of strmiids?

LGS at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 2
/OUT:"C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2005\Projects\hallo\Debug\hallo.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\hallo.exe.intermediate.manifest" /DEBUG /ASSEMBLYDEBUG /PDB:"c:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2005\Projects\hallo\debug\hallo.pdb" /SUBSYSTEM:WINDOWS /ENTRY:"main" /MACHINE:X86 /FIXED:No /ERRORREPORT:PROMPT ole32.lib strmiids.lib

That confuse me, I added the directory with "strmiids.lib" .

btw. when I add the ole32.lib, I get this errors now:

1>Verknüpfen...
1>hallo.obj : error LNK2020: Nicht aufgel?stes Token (0A00000F) IID_IMediaEvent.
1>hallo.obj : error LNK2020: Nicht aufgel?stes Token (0A000010) IID_IMediaControl.
1>hallo.obj : error LNK2020: Nicht aufgel?stes Token (0A000011) CLSID_FilterGraph.
1>hallo.obj : error LNK2020: Nicht aufgel?stes Token (0A000012) IID_IGraphBuilder.
1>hallo.obj : error LNK2001: Nicht aufgel?stes externes Symbol "IID_IMediaEvent".
1>hallo.obj : error LNK2001: Nicht aufgel?stes externes Symbol "IID_IMediaControl".
1>hallo.obj : error LNK2001: Nicht aufgel?stes externes Symbol "IID_IGraphBuilder".
1>hallo.obj : error LNK2001: Nicht aufgel?stes externes Symbol "CLSID_FilterGraph".
1>C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2005\Projects\hallo\Debug\hallo.exe : fatal error LNK1120: 8 nicht aufgel?ste externe Verweise.
1>Das Buildprotokoll wurde unter "file://c:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2005\Projects\hallo\hallo\Debug\BuildLog.htm" gespeichert.
1>hallo - 9 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========

ReneAlexander at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 3
Hello, no one here, who can help me?
I′m really frustrated. I searched the internet, but didn′t find a solution.
So please help!!!!
ReneAlexander at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 4
Are you using /CLR? I don't believe /CLR:Pure works with DS.
LGS at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 5
Yeah, that′s it!!!
ReneAlexander at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...
# 6
I have almost the same problem; i tried with a CLR console application and with win32console application
Oscarlenders at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,DirectShow Development...

Software Development for Windows Vista

Site Classified