G
Guest
I've just started using managed C++ with VS2005, so please forgive my
ignorance.
I'm investigating producing a managed wrapper for some functionality of the
Windows Media Format SDK.
I have the following very simple header and class files:
Header File:
// CSJ.h
#pragma once
using namespace System;
namespace CSJ {
public ref class Class1
{
private:
IWMReader* m_pReader;
public:
void Init();
};
}
Class File:
// This is the main DLL file.
#include "stdafx.h"
#include <vcclr.h>
#include <wmsdk.h>
#include <asferr.h>
#include <nserror.h>
#include "CSJ.h"
void CSJ::Class1::Init()
{
HRESULT hr;
hr = WMCreateReader(NULL, WMT_RIGHT_PLAYBACK, &m_pReader);
}
This results in a compilation error C2664: 'WMCreatereader' : cannot convert
parameter 3 from 'cli::interior_ptr<Type>' to 'IWMReader **'
If I move the declaration of m_pReader into the Init() function everything
compiles, but I need m_pReader as a class level variable. How do I correctly
declare m_pReader ?
Any help would be appreciated.
Thanks
Steve
ignorance.
I'm investigating producing a managed wrapper for some functionality of the
Windows Media Format SDK.
I have the following very simple header and class files:
Header File:
// CSJ.h
#pragma once
using namespace System;
namespace CSJ {
public ref class Class1
{
private:
IWMReader* m_pReader;
public:
void Init();
};
}
Class File:
// This is the main DLL file.
#include "stdafx.h"
#include <vcclr.h>
#include <wmsdk.h>
#include <asferr.h>
#include <nserror.h>
#include "CSJ.h"
void CSJ::Class1::Init()
{
HRESULT hr;
hr = WMCreateReader(NULL, WMT_RIGHT_PLAYBACK, &m_pReader);
}
This results in a compilation error C2664: 'WMCreatereader' : cannot convert
parameter 3 from 'cli::interior_ptr<Type>' to 'IWMReader **'
If I move the declaration of m_pReader into the Init() function everything
compiles, but I need m_pReader as a class level variable. How do I correctly
declare m_pReader ?
Any help would be appreciated.
Thanks
Steve