|
I added code for Seek() method but problem is same.
ULONG lreal = 0;
LARGE_INTEGER liBegining = { 0 };
if(S_OK && pstream)
{
pstream->Write(chIncomingDataBuffer, iEnd, &lreal );
pstream->Seek(liBegining, STREAM_SEEK_SET, NULL);
this is the added code.
But there is nothing.
|
|
|
|
|
Wait a second. I see that you changed the code. You have a bug in if(S_OK && pstream) . The value of S_OK is zero, so in the code above you are not not going to do the Write() and the Seek() .
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Yes i also get this., S_OK is zero.
But If I'm removing this then pstream is having some value.
Is there any problem with CreateStreamOnHGlobal()?
and one more thing,, as I got I can't draw anything outside paint event
if I'm limited to GDI+.
|
|
|
|
|
It seems this is not an easy fix, so let me ask you a couple of things.
- Do you have to use the Image and Graphics stuff?
- What is the format of your images (BMP, JPG, etc.)?
- Are you going to be drawing anything on top of your image?
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
-I'll have to recv some data on winsock socket and then display that on screen.
I'm using Image and Graphics it for ease.
-Its BMP
-No nothing on top of my image.
-> I'll have to recv the bytes and display image data on screen without saving it first.
|
|
|
|
|
Good, I figured it was something like this - there are so many classes and tools that need to load the images from file in order to display them, but you have to search hard to find some that will let you load an image already in memory.
Take a look at this article: Simple class for drawing pictures (JPG, TIFF, GIF, etc...)[^]
Examine the code to figure out what is wrong with your code or just use the class in your project. I know it is old and there might be newer stuff out there, but I have used the class to perform similar tasks. I have a project where I am using a button class derived from this class and it makes it possible to display just about any image on the buttons.
It has been so long since I looked at the code, that I did not remember it uses a similar approach as you did with the IStream object, so I am sorry I brought that into question.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
|
Ahhh, I see. Sorry if I stepped on your toes, I should have checked for something like that.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
SoMad wrote: Sorry if I stepped on your toes You didn't; I just thought some background detail may be useful.
Use the best guess
|
|
|
|
|
You also posted this question at Display image from stream[^]. Please do not post the same question in multiple forums.
Use the best guess
|
|
|
|
|
Yeah Sorry for posting at two places.
But the code that was to be implemented is not returning an image, as I implemented that in my code.
So I just wrote it as a new question instead revising the old one.
Thanks!
|
|
|
|
|
toms from newdelhi wrote: So I just wrote it as a new question instead revising the old one. On the contrary, you posted the same question in this forum and in Q&A. Common sense should tell you that is the wrong thing to do, but if you still don't understand then read http://www.codeproject.com/Messages/2922875/HOW-TO-ASK-A-QUESTION.aspx[^], especially point 1.
Use the best guess
|
|
|
|
|
Hi
I'm new in DirectShow programming, and after more than week of reading a lot and trying to understand some of the concepts, without a luck I'm asking my question:
I used the filter EZRGB24 from Microsoft SDK and changed it according to my need and checked it out with graphedit to see it works.
Now I need to use this filter in my code.
1. How can I use some filters in row?
2. Can I use the buffers of the last filter in my code? I don't need to save the stream or display it.
Thank you,
Moshiko
|
|
|
|
|
How to build 64 bit application on visual studio 2003?
|
|
|
|
|
|
VS 2003 does not support the 64-bit compiler out of the box.
You can however, install the latest Microsoft SDK and use the 64-bit compiler that comes along with it.
But it is recommended to go for VS2005, which supports building 64-bit applications out of the box.
|
|
|
|
|
Thank you Superman for valuable information.
|
|
|
|
|
Hello ,
I am Lakshmanan, a new to MFC.
I have created a multilanguage supported application in mfc.
The below problem occurs in SImplfied and Traditional Chineese localization only
I Have created a dialog having Textbox, buttons , radiobutton and check boxes.
When Displaying the dialog box for the first time, the text inside the button control is not visible fully.
Alignment set in the button control property is Default.
But, on closing the dialog box and opening it again causes the text to be visible clearly and fully.
Also, if the check box state is changed (From Checked to Unchecked), the text inside button is clearly and fully visible.
Also on tab change, (means getting focus to button), the text inside button is getting clearly and fully visible.
Anyone please help me to sort out the problem.
Thanks in advance.
Regards,
Lakshmanan
|
|
|
|
|
I didnot know what happen. Does you project set as Unicode. Or you system have the suitable Chinese Font?
If you can get screen image, perhaps I can help you.
|
|
|
|
|
Hello Mr. yu-jian,
Thanks for your Quick reply.
The Project is Set to Multibyte Character Set.
I have Installed Language Packs for chinese (both traditional and simplified)
Thanks
Lakshmanan
|
|
|
|
|
Hi, You should set this project as UNICODE type. In China, we use the Multibyte Character Set only when we develop the English version software.
|
|
|
|
|
It is not clear to me if this problem happens with the Button, RadioButton or CheckBox controls or if it happens with all of the controls?
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Is there an equivalent of the system() C function in MFC?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
system does exist in VS2003+ libraries - I cant remember the details but its http://msdn.microsoft.com/en-us/library/277bwbdz(v=vs.80).aspx[^]
try using
::system(command);
that being said, I'd use CreateProcess API instead - it give much more control .. as for the 'MFC' part of your question, MFC is just a higher order level of classes/abstractions anyway
|
|
|
|
|
Or perhaps ShellExecute.
Steve
|
|
|
|