dvplayltd
asked on
How to convert IUnknownPtr to Visual Basic 6 ?
Hello experts !
I has ActiveX DLL, that is used from MS Visual C++. Here is fragment of code:
*******
IUnknownPtr punkSource;
hr = m_pBridge->InsertSourceFil ter(m_pSou rceGraphSi nkFilter, m_pCaptureGraph, &punkSource);
IBaseFilterPtr pfSource = punkSource;
********
In it "m_pBridge" is ActiveX, that I MUST use from VB 6.
What type to use in VB6 so I can not get run time error 13 - "Type mismatch?" due to type of punkSource ? I has try Object, Variant but NO susess :(
Any help will be OK.
I has ActiveX DLL, that is used from MS Visual C++. Here is fragment of code:
*******
IUnknownPtr punkSource;
hr = m_pBridge->InsertSourceFil
IBaseFilterPtr pfSource = punkSource;
********
In it "m_pBridge" is ActiveX, that I MUST use from VB 6.
What type to use in VB6 so I can not get run time error 13 - "Type mismatch?" due to type of punkSource ? I has try Object, Variant but NO susess :(
Any help will be OK.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have 25 C, 6pm ;)
Sorry, answering another question...
I will review for a while...
I will review for a while...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
For _ys_
I think that I know where the problem is, however I do NOT know what is exact solution. I am experience Visual Basic project leader that use hard code VB with many API, objects, Polymorphism and so on.
The problem is when punkSource (...[out, retval] IUnknown** ppFilter...) is return to VB. It is pointer to custom object that has NO equivalent in VB. Since i just need to pass it to others metod in same ActiveX I do NOT care what it is :) But VB require to know it type :)
For me is important to inderstand what actyaly contain 3 param (at hr = m_pBridge->InsertSourceFil ter(m_pSou rceGraphSi nkFilter, m_pCaptureGraph, &punkSource) ) ?
Long (int in C++) to memory address where is object ? Or somethink other ? If I print ppFilter what I will see - adress where is object or adress where is long value that conatain memory address ?
I think that I know where the problem is, however I do NOT know what is exact solution. I am experience Visual Basic project leader that use hard code VB with many API, objects, Polymorphism and so on.
The problem is when punkSource (...[out, retval] IUnknown** ppFilter...) is return to VB. It is pointer to custom object that has NO equivalent in VB. Since i just need to pass it to others metod in same ActiveX I do NOT care what it is :) But VB require to know it type :)
For me is important to inderstand what actyaly contain 3 param (at hr = m_pBridge->InsertSourceFil
Long (int in C++) to memory address where is object ? Or somethink other ? If I print ppFilter what I will see - adress where is object or adress where is long value that conatain memory address ?
FYI,
VB object is equivalent to C++ [/COM] IDispatch interface.
VB object is equivalent to C++ [/COM] IDispatch interface.
ASKER
Here is declaration at function of ActiveX that I must call from VB 6. I hope this will provide you with necassery info .
HRESULT InsertSourceFilter(
[in] IUnknown* pUnkSourceGraphSinkFilter,
[in] IUnknown* pRenderGraph,
[out, retval] IUnknown** ppFilter);