Hi. I am new with Microsoft Visual C++ development. We have a requirement to extract the SMPTE timecode from a WMV file using Windows Media Format SDK. The WMF SDK requirement is the file must be indexed by timecode. I want to write a WMF file indexer
using the WMF SDK and currently currently following the programming reference here
http://msdn.microsoft.com/en-us/library/dd757738(VS.85).aspx http://msdn.microsoft.com/en-us/library/dd757738(VS.85).aspx
I installed Windows Media Format SDK 11 and Visual Studio 2010.
First I created a Win32 project and added a class "MyCallback" to it. "MyCallback" need to implement
IWMStatusCallback interface.
When I tried to build the project I am getting
Error 1 error LNK2001: unresolved external symbol "public: virtual long __stdcall MyCallback::OnStatus(enum WMT_STATUS,long,enum WMT_ATTR_DATATYPE,unsigned char *,void *)" ( mailto:?OnStatus@MyCallback@@UAGJW4WMT_STATUS@@JW4WMT_ATTR_DATATYPE@@PAEPAX@Z ?OnStatus@MyCallback@@UAGJW4WMT_STATUS@@JW4WMT_ATTR_DATATYPE@@PAEPAX@Z ) C:SilverProjectsWMMIndexerWMMIndexerMyCallback.obj WMMIndexer<br/>
<br/>
Attach are the sourcecode.
MyCallback.cpp
<div style="color:Black;background-color:White; <pre>
#include <span style="color:#A31515; "StdAfx.h"
#include <span style="color:#A31515; "MyCallback.h"
HANDLE g_hEvent;
MyCallback::MyCallback(<span style="color:Blue; void)
{
}
MyCallback::~MyCallback(<span style="color:Blue; void)
{
}
HRESULT STDMETHODCALLTYPE OnStatus(
<span style="color:Green; /* [in] */ WMT_STATUS Status,
<span style="color:Green; /* [in] */ HRESULT hr,
<span style="color:Green; /* [in] */ WMT_ATTR_DATATYPE dwType,
<span style="color:Green; /* [in] */ BYTE *pValue,
<span style="color:Green; /* [in] */ <span style="color:Blue; void *pvContext) {
<span style="color:Blue; switch( Status )
{
<span style="color:Blue; case WMT_OPENED:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_EOF:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_CLOSED:
SetEvent(g_hEvent);
<span style="color:Blue; break ;
<span style="color:Blue; case WMT_STOPPED:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_STARTED:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_LOCATING:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_TIMER :
<span style="color:Blue; break;
}
<span style="color:Blue; return S_OK;
}
[/code]
MyCallback.h
<pre>#pragma once
#include "wmsdkidl.h"
class MyCallback :
public IWMStatusCallback
{
public:
MyCallback(void);
~MyCallback(void);
HRESULT STDMETHODCALLTYPE OnStatus(
/* [in] */ WMT_STATUS Status,
/* [in] */ HRESULT hr,
/* [in] */ WMT_ATTR_DATATYPE dwType,
/* [in] */ BYTE *pValue,
/* [in] */ void *pvContext);
};
[/code]
<pre> [/code]
Could you please help me fix the problem. Thanks.
View the full article
using the WMF SDK and currently currently following the programming reference here
http://msdn.microsoft.com/en-us/library/dd757738(VS.85).aspx http://msdn.microsoft.com/en-us/library/dd757738(VS.85).aspx
I installed Windows Media Format SDK 11 and Visual Studio 2010.
First I created a Win32 project and added a class "MyCallback" to it. "MyCallback" need to implement
IWMStatusCallback interface.
When I tried to build the project I am getting
Error 1 error LNK2001: unresolved external symbol "public: virtual long __stdcall MyCallback::OnStatus(enum WMT_STATUS,long,enum WMT_ATTR_DATATYPE,unsigned char *,void *)" ( mailto:?OnStatus@MyCallback@@UAGJW4WMT_STATUS@@JW4WMT_ATTR_DATATYPE@@PAEPAX@Z ?OnStatus@MyCallback@@UAGJW4WMT_STATUS@@JW4WMT_ATTR_DATATYPE@@PAEPAX@Z ) C:SilverProjectsWMMIndexerWMMIndexerMyCallback.obj WMMIndexer<br/>
<br/>
Attach are the sourcecode.
MyCallback.cpp
<div style="color:Black;background-color:White; <pre>
#include <span style="color:#A31515; "StdAfx.h"
#include <span style="color:#A31515; "MyCallback.h"
HANDLE g_hEvent;
MyCallback::MyCallback(<span style="color:Blue; void)
{
}
MyCallback::~MyCallback(<span style="color:Blue; void)
{
}
HRESULT STDMETHODCALLTYPE OnStatus(
<span style="color:Green; /* [in] */ WMT_STATUS Status,
<span style="color:Green; /* [in] */ HRESULT hr,
<span style="color:Green; /* [in] */ WMT_ATTR_DATATYPE dwType,
<span style="color:Green; /* [in] */ BYTE *pValue,
<span style="color:Green; /* [in] */ <span style="color:Blue; void *pvContext) {
<span style="color:Blue; switch( Status )
{
<span style="color:Blue; case WMT_OPENED:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_EOF:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_CLOSED:
SetEvent(g_hEvent);
<span style="color:Blue; break ;
<span style="color:Blue; case WMT_STOPPED:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_STARTED:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_LOCATING:
<span style="color:Blue; break;
<span style="color:Blue; case WMT_TIMER :
<span style="color:Blue; break;
}
<span style="color:Blue; return S_OK;
}
[/code]
MyCallback.h
<pre>#pragma once
#include "wmsdkidl.h"
class MyCallback :
public IWMStatusCallback
{
public:
MyCallback(void);
~MyCallback(void);
HRESULT STDMETHODCALLTYPE OnStatus(
/* [in] */ WMT_STATUS Status,
/* [in] */ HRESULT hr,
/* [in] */ WMT_ATTR_DATATYPE dwType,
/* [in] */ BYTE *pValue,
/* [in] */ void *pvContext);
};
[/code]
<pre> [/code]
Could you please help me fix the problem. Thanks.
View the full article