|
I want to play the .mov file in the directshow. I am able to play
the .mov file in the graphedit. But when I am using code for this then it is not add in the graphedit.
my code is
DEFINE_GUID(CLSID_QuickTimeDecoder,0x64c6bf57,0x2d38,0x4d10,0xa1,0xdf,0x33,0x0a,0xd9,0x8c,0xd4,0xc2);
// Create the filter graph manager and query for interfaces.
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,IID_IGraphBuilder, (void **)&pGraph);
if (FAILED(hr))
{
printf("ERROR - Could not create the Filter Graph Manager.");
return;
}
hr = CoCreateInstance(CLSID_QuickTimeDecoder,NULL,CLSCTX_INPROC_SERVER,IID_IBaseFilter,(void **)&QuickTime);
if(FAILED(hr))
{
MessageBoxA(NULL,"failed to CLSID_QuickTimeDecoder","",NULL);
}
hr = pGraph->AddFilter(QuickTime,L"Quick Time Decoder");
if(FAILED(hr))
{
MessageBoxA(NULL,"failed Quick Time Decoder","",NULL);
}
hr = QuickTime->QueryInterface(IID_IFileSourceFilter,(void **)&pReader);
if(FAILED(hr))
{
ShowMessage(hr);
}
hr = pReader->Load(L"C:\\Documents and Settings\\Equinox\\Desktop\\movutvi\\dlf.mov",NULL);
if(FAILED(hr))
{
ShowError(hr);
ShowMessage(hr);
}
I am getting the problem at pReader->Load().where i am wrong
pls help me.
|
|
|
|
|
Hai!
In my dialog box i am able to display bitmap images by inserting an picture control in my dialog box and using the following code in Visual C++ :
HBITMAP hBitmap;
hBitmap = (HBITMAP) LoadImage (NULL, "C:\\Documents and Setttings\\MyPC\\Desktop\\MyImage.bmp", IMAGE_BITMAP, SM_CXICON, SM_CYICON, LR_LOADFROMFILE);
csMyImage.SetBitmap (hBitmap);
But how can i display .jp2 and .jpg images in my dialog box
Thanks!
|
|
|
|
|
|
Thankyou !
Assuming that both .jpg and.jp2 file are present in :
C:\Documents and Settings\MyFolder
Now can you please code me how to display the images , Itried but not successful!
Thanks!
|
|
|
|
|
You can use CImage class.
#include "atlimage.h"
CImage pImage;
HRESULT hResult = pImage.Load(m_TempPath);
if (FAILED(hResult)) {
.....
}
CSize m_ScrSize;
m_SrcSize.cx=m_ImageSize.cx=pImage.GetWidth();
m_SrcSize.cy=m_ImageSize.cy=pImage.GetHeight();
CClientDC *pDC;
pImage.StretchBlt(pDC->m_hDC,0,0,m_ImageSize.cx,m_ImageSize.cy,0,0,m_SrcSize.cx,m_SrcSize.cy,SRCCOPY);
pImage.Destroy();
|
|
|
|
|
I am getting the following error message
Run-Time Check Failure #3 - The variable 'pDC' is being used without being defined.
Thanks!
|
|
|
|
|
Hello All,
I am trying to convert a list of Strings in LPWSTR* array. I am using the following way to convert it. But here the problem occurs in the returning array items. It contains all the elements same in the array. I found the problme is due to memset() which updates the memory address everytime same as earlier. Please help me out----
for(DWORD i = 0; i < itemIds->Count; i++)
{
ATL::CComBSTR itemWChar;
itemWChar = ::GetAtlBstr(itemIds[i]);
WCHAR _itemWChar[_MAX_PATH];
memset(_itemWChar, 0, sizeof(_itemWChar) / sizeof(_itemWChar[0]));
memcpy(_itemWChar, static_cast<bstr>(itemWChar), itemWChar.ByteLength());
items[i] = _itemWChar;
}
ANURAG VISHNOI,
Sr. Software Engineer,
|
|
|
|
|
First of all: why do you need such conversion ? Most of the time, you can simply use TCHAR strings and everything sould be fine. You only need such conversions in very very specific cases (e.g. you developp a UNICODE application and you are using a library which doesn't support UNICODE, ...). I suggest you read this excellent article[^], things will be a bit clearer for you.
For your code snippet, there are quite some errors. If you want to retrieve the lenght of a string, don't use sizeof but strlen (or it's equivalent unicode version). Furthermore, your code snippet is incomplete, so it is difficult to understand. What is itemWChar ? Is that a typo and it should be _itemWChar or is it another variable ?
|
|
|
|
|
Hey Thanks for response.
Well I have a function which takes the list of Strings as input. Now I need to supply this list into another function which does not take this list directly. As the 2nd function takes the input in form of LPWSTR*, hence I have to convert it. In below code itemWChar is defined as ATL::CComBSTR and _itemWChar is the string which is going to have the value of each ItemId in every iteration of loop. I think I am clear now....????
//itemIds is List<string^>^. (I am writing the managed code here)
for(DWORD i = 0; i < itemIds->Count; i++)
{
ATL::CComBSTR itemWChar;
itemWChar = ::GetAtlBstr(itemIds[i]);
WCHAR _itemWChar[_MAX_PATH];
memset(_itemWChar, 0, sizeof(_itemWChar) / sizeof(_itemWChar[0]));
memcpy(_itemWChar, static_cast(itemWChar), itemWChar.ByteLength());
items[i] = _itemWChar;
}
Please let me know if you can solve this.
ANURAG VISHNOI,
Sr. Software Engineer,
|
|
|
|
|
If you are using managed code, then you should ask your question in the managed C++ forum. This forum is for C++ only.
Anyway, the link I gave you could still be very usefull to understand the different strings.
|
|
|
|
|
Hey - don't crosspost[^] - it's rude.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i want to design a PCM detecter so i ve to program encoder and decoder for this in C++.
|
|
|
|
|
NamraHayee wrote: PCM detecter so i ve to program encoder and decoder
How are these related?
NamraHayee wrote: code required
Good joke Namra!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
is it a joke?than what else i can do to design a pcm detecter?
|
|
|
|
|
For instance, you may actually design it instead of issuing 'get me codez plz'.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Codeproject has an example[^] of convert mp3/wav to pcm maybe its helpful for you.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
hi,all.
i have a puzzle for this problem that i can use ON_EN_CHANGE like this:
ON_EN_CHANGE(IDC_IPADDRESS_NVR_IPADDR, OnFieldchangedIpaddressNvrIpaddr)
i thought ON_EN_CHANGE can only used for CEdit control because MicroSoft defined the ON_EN_CHANGE:
#define ON_EN_CHANGE(id, memberFxn) \
ON_CONTROL(EN_CHANGE, id, memberFxn)
and
#define EN_CHANGE 0x0300
and in MSDN:
Edit Control Handlers
ON_EN_CHANGE( <id>, <memberfxn> ) afx_msg void memberFxn( );
all of these defined in CEdit, so why i can used in IPCtrl? thank u very much.
</memberfxn></id>
|
|
|
|
|
kaviniswell wrote: all of these defined in CEdit, so why i can used in IPCtrl? thank u very much.
Because the IP Address control is made up of four edit controls, so IP address control must be forwarding this message to it's parent window.
|
|
|
|
|
Because the IP Address control is made up of four edit controls, so IP address control must be forwarding this message to it's parent window.
---------
the IP Address control is made up of four edit controls? but we know:
class CIPAddressCtrl : public CWnd
{...
class CEdit : public CWnd
{...
so it seems like no this relation between CIPAddressCtrl and CEdit?
|
|
|
|
|
What I meant was these edit controls are it's child controls. This MFC class is just a wrapper around it's SDK version, so you don't those edit controls as members.
Use Spy++ to locate these edit controls.
|
|
|
|
|
ok, i see. thank u very much.
|
|
|
|
|
Nibu babu thomas wrote: Use Spy++ to locate these edit controls.
humm.. teaching hacking!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok umm.. teaching hacking!
Naah, an interesting tool to use when developing in windows. There is another one called WinID (quick and fast, very useful to me )
|
|
|
|
|
Hello guys,
Hope you can help me with this one.
For example,
BYTE buf[100000]; // contains binary data of an image
I wanted it to be written in an image file(*.bmp).
Thanks in advance.
modified on Wednesday, April 22, 2009 10:28 PM
|
|
|
|
|
You can use CFile object to write or read a binary file.
|
|
|
|
|