|
tasmin iqbal wrote: i use
jbig.lib
j2000.lib
cximage.lib
demo.lib
Jpeg.lib
Did you add those libraries (or at least the CXImage.lib) to your project settings ?
|
|
|
|
|
yes i did add them to my project
|
|
|
|
|
Help. Please. How can I solve DirectShow issues.
unresolved CLSID CLSID_CaptureGraphBuilder2. I can not find this in the registry either.
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **) & g_pGraph);
fails.
I am using Win XP, VS 2005
MS SDK February 2003 SDK Release
Microsoft DirectX SDK (August 2007)
Is there a version mismatch.
Samples do not compile either.
Thanks in advance.
|
|
|
|
|
ICaptureGraphBuilder2 is an interface not the object, shall be refered as IID_ICaptureGraphBuilder2 as in ,
CoCreateInstance( CLSID_CaptureGraphBuilder,
NULL,
CLSCTX_INPROC_SERVER,
IID_ICaptureGraphBuilder2,
(void**) &pCaptureGraphBuilder)
ICaptureGraphBuilder2 is exposed by CaptureGraphBuilder (There is no CLSID_CaptureGraphBuilder2)
|
|
|
|
|
Thanks for the reply. I guess I am too new to this. Still many samples from CP are not compiling. So it is not even my code.
Thanks,
|
|
|
|
|
I've got an assignment that I've been struggling with all day, and after re-doing the program several times I believe I've narrowed down my problem to this:
#include <stdio.h>
#include <stdlib.h>
int random;
int guess;
char play = 'y';
int game = 1;
int main()
{
while(game == 1)
{
if(play == 'y')
{
random = 1 + rand() % 1000;
printf("\nI have a number between 1 and 1000.\nCan you guess my number?\nType your first guess:");
play = 'v';
}
scanf("%i",&guess);
if(guess == random)
{
printf("\nExcellent! You guessed the number!\nWould you like to play again?(y/n)");
scanf("%c",&play);
if(play == 'n')
{
game = 0;
}
}
else
{
if(guess < random && guess != random)
{
printf("\nToo low, try again!");
}
if(guess > random && guess != random)
{
printf("\nToo high, try again!");
}
}
}
return 0;
}
</stdlib.h></stdio.h>
When I enter the if(guess == random){} block and answer the (y/n) question, the program falls apart. No matter what I seem to do, it'll shut down, stop functioning, or repeat that block once more before it moves on to what it's supposed to do. I don't understand what I'm doing wrong.
|
|
|
|
|
your program is too difficult to get the right number.
because every time after one loop your random have changed, who can guess a unmber just equal one random number form 1 to 1000.
|
|
|
|
|
StateofMind09 wrote: if(guess < random && guess != random)
{
printf("\nToo low, try again!");
}
if(guess > random && guess != random)
{
printf("\nToo high, try again!");
}
Funny.
Do you really think
if ( guess < random )
{
}
else
{
}
is not enough?
[added]
BTW: It shouldn't 'fall apart'. Why don't you use the debugger to see what actually happens?
[/added]
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]
modified on Thursday, April 23, 2009 4:11 AM
|
|
|
|
|
Your problem is that when you enter the correct guess, you type a return character after the number to terminate the line. The scanf("%c",&play); line will then read that character as your (first) response, rather than the 'y' or 'n'.
I would recommend altering that bit of the program into a loop, so it validates your input, so instead of this:
scanf("%c",&play);
if(play == 'n')
{
game = 0;
}
have this:
do
{
scanf("%c", &play);
} while (play != 'y' && play != 'n');
if(play == 'n')
{
game = 0;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
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 )
|
|
|
|
|