|
cmk wrote: but i was looking for a real world use in C++.
Any example where you use a static variable would do. My thought is simple. A class can continue to represent it's core, solid members, in addition to that, it could house static variables and mimic the usage of static variables as if they are members of the class, instead of the messy-current implementation. C# static constructor looks like one way of managing the static clutters inside the class. The idea sounded good at least. Stuarts had better expressed the same below. You might look at that one too.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
In addition to the above comments, also notice that you might access a static variable of a class before you have any instances of it.
|
|
|
|
|
Niklas Lindquist wrote: In addition to the above comments, also notice that you might access a static variable of a class before you have any instances of it.
leaves me thinking. Yep so C# is right by having a static constructor. I think it takes care of this scenario. Let me dive into it & test . Thanks man
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Hi to all,
Please suggest me a good 'AVC/H.264 Video Decoder", having 'Quarter Resolution' property.
Thanks & Regards,
Aniket A. Salunkhe
|
|
|
|
|
|
Hi,
I am creating a filtergraph in DirectShow (windows).
How can I use libavcodec in my case?
Simulated filter graph is,
"MPEG-2 Multicast Receiver" --> "MPEG-2 Demultiplexer" --> "Video Decoder" --> "Video Renderer"
It is receiving H264 ASI Stream.
I am creating an output video pin 'v1' to "MPEG-2 Demultiplexer" with following settings,
<br />
VideoInfoHeader hdr = new VideoInfoHeader();<br />
hdr.BmiHeader = new BitmapInfoHeader();<br />
hdr.BmiHeader.Compression = 0x68323634;<br />
<br />
vid_media.majorType = MediaType.Video;<br />
vid_media.subType = ExtraFunctions.MediaSubTypeH264;<br />
vid_media.formatType = FormatType.Mpeg2Video;<br />
vid_media.fixedSizeSamples = false;<br />
vid_media.temporalCompression = false;<br />
vid_media.sampleSize = 0;<br />
vid_media.formatSize = Marshal.SizeOf(hdr);<br />
vid_media.formatPtr = Marshal.AllocCoTaskMem(vid_media.formatSize);<br />
Marshal.StructureToPtr(hdr, vid_media.formatPtr, false);
Pin 'v1' is not connecting to "ffdshow Video Decoder". I can connect pin 'v1' to "MainConecpt AVC/H.264 Video Decoder". "MainConecpt AVC/H.264 Video Decoder" is not having resolution setting, which I want to set as 'Quarter'.
Michael Schubert wrote: http://ffmpeg.mplayerhq.hu/index.html[^] ?
How can I use libavcodec?
Is there any onther video decoder?
Is there any thing wrong in video output settings?
Thanks & Regards,
Aniket A. Salunkhe
|
|
|
|
|
Guid H264SubType = new Guid("8D2D71CB-243F-45E3-B2D8-5FD7967EC09B");
|
|
|
|
|
Aniket Salunkhe wrote: How can I use libavcodec?
I don't know, you have to get famliar with the API. I just know that many video tools use this library because it's open source and works apparently pretty well.
|
|
|
|
|
Hi,
I think I am missing some thing while creating H.264 video output pin to "MPEG-2 Demultiplexer". Because that pin is not connecting to most of the H264/AVC Video Decoder.
Please guide me to create video output pin (for H.264) to "MPEG-2 Demultiplexer".
Actually I want to render multiple multicast sources which are in H.264 format.
Thanks & Regards,
Aniket A. Salunkhe
|
|
|
|
|
I checked the compiler command line,
only /Yu and /Fp there for pch,
and all works well.
But when I create an empty win32 project,
and try to enable the pch mechanism in the same way
(the same compiler command line, also add the default stdafx.h/cpp),
it doesn't work.
What is the problem?
BTW, it's tested in VS2008.
|
|
|
|
|
The /Yc option is set only for stdafx.cpp, over-writing the project default of /Yu.
Right-click on stdafx.cpp and check its properties - you'll see /Yc set.
You can do the same thing in your Win32 project (set /Yc for stdafx.cpp rather than /Yu).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
for (int l=0;l<5;l++)
{
DBGetText(hWndGet);
TextInfoSend(hWndSend, ts);
hTimer = CreateWaitableTimer(NULL, FALSE, NULL);
LARGE_INTEGER liDueTime;
liDueTime.QuadPart = -1000LL;
SetWaitableTimer(hTimer, &liDueTime, 0, NULL, NULL, 0);
(WaitForSingleObject(hTimer, INFINITE) != WAIT_OBJECT_0);
CancelWaitableTimer(hTimer);
All the above minus the for loop works when inserted in a command button.
HWND hWnd1;
hWndout = FindWindow("NotePad",NULL);
if (hWndout)
{
l=2;
}
}
After having done the for loop my data only refreshes when I exit the loop.
BTW I am using WM_COPYDATA inside TextInfoSend function to transmit data.
Can someone shed somelight as to what I have missed to get my data to refresh.
Thanks A Million.
|
|
|
|
|
I'm not completely sure what you are trying to accomplish there but my guess would be that your loop runs in your GUI thread, this means, no messages will be processed during the workings of the loop, thus the unrefreshed and unreponsive GUI (if your loop takes longer then windows will also consider your process unreponsive and you probably will get the nice "Not responding..." text in the titlebar of your main window - if you have one that is). To avoid this you can try putting your loop in a separate thread.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes. That is whats happening. I guess since i am new at this, there was nothing in the code that I have done wrong. My next dumb question is How do I create a new process from the GUI.
thanks a million.
|
|
|
|
|
I asusme you meant "tread", not "proccess", i recommend reading this[^] for starters and then checking out CreateThread[^]. After that, if you have questions, feel free to ask.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Thank you. I found a prototype to use one too. That does work perfectly for about 10 minutes or so.
After the 10 minutes I get an error which says my buffer is too small.
Withinn other functions of the application, I know I am clearing all variables and closing and reopening the file in one function and as soon as the writing is done I am closing the file and clearing the variables.
Any suggetions as to where I could be going wrong?.
|
|
|
|
|
Well, without seeing your code it's hard to say...try finding out if your 'cleanup code' really gets called or not by placing breakpoints, or TRACE-es, or a message box, or or or...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Here is the section I am having problems with:
This is in a function of it's own:
Instead of using WindowFromPoint I am using hWnd that I have for the window
I am after since the user could have moved it.
POINT Textpt;
Textpt.x = a;
Textpt.y = c;
HDC DlgDC,MemDC,DeskDC;
int height, width;
HBRUSH hBrush;
HBITMAP hBitmap;
DlgDC = GetDC(hWnd);
DeskDC = GetDC(NULL);
hBrush = CreateSolidBrush(RGB(255,25,0));
width= 53;
height= 8;
MemDC = CreateCompatibleDC(DlgDC);
hBitmap = CreateCompatibleBitmap(DlgDC,width,height);
SelectObject(MemDC,hBitmap);
BitBlt(MemDC,0,0,width,height ,DeskDC,Textpt.x,Textpt.y,SRCCOPY);
////
Some processing....
Couple of If statements and geting color pixels.
////
after above is done processing->
ReleaseDC(NULL,MemDC);
DeleteObject(MemDC);
ReleaseDC(NULL,DlgDC);
DeleteObject(DlgDC);
ReleaseDC(NULL,DeskDC);
DeleteObject(DeskDC);
Please help if its wrong...
This is the only part that dies after 10 minutes. I ran this with the thread, I commented the rest of the app including the processing in between the above code.
I ran the thread own its own without the above it ran fine. All the thread was doing at that point was getting the handle to the window I am after.It ran for a long time.
Thanks a million.
|
|
|
|
|
This:
MemDC = CreateCompatibleDC(DlgDC);
must be "freed" like this:
DeleteDC(MemDC);
ReleaseDC does not need to be used for the memory DC, and DeleteObject is not for device contexts at all.
This:
DlgDC = GetDC(hWnd);
needs to be released like this:
ReleaseDC(hWnd, DlgDC);
ReleaseDC(NULL, DlgDC) is wrong, you need to specify the same window handle you used to get the DC. And once again, don't use DeleteObject for a DC.
Also note, when you select objects into a DC, may those be bitmaps or brushes or whatever, the original objects should be select back into the DC before you delete the DC or delete objects that were selected into the DC. To explain this a bit more clearly:
This is not complete:
HDC MemDC = CreateCompatibleDC(DlgDC);
HBITMAP bitmap = CreateCompatibleBitmap(MemDC, 100, 100);
SelectObject(MemDC, bitmap);
...
DeleteDC(MemDC);
DeleteObject(bitmap);
Should be done something like this:
HDC MemDC = CreateCompatibleDC(DlgDC);
HBITMAP bitmap = CreateCompatibleBitmap(MemDC, 100, 100);
HBITMAP originalbitmap = (HBITMAP)SelectObject(MemDC, bitmap);
...
SelectObject(MemDC, originalbitmap);
DeleteDC(MemDC);
DeleteObject(bitmap);
If you do not follow this "rule", your program will leak GDI resources...
Also one very important thing you should know about threads is that fiddling with GUI objects in other than the GUI thread is strongly not recommended.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
thanks a million. I will change a few things and give it a try.
|
|
|
|
|
Same thing in about 15 to 20 minutes at least it took a bit longer. I have a question. I am trying to capture text from an external app. the text on the app is being populated with WM_PAINT. Not sure even if a WM_PAINT hook to this application will help. What are my choices if this keeps not responding to the route I have taken.?
|
|
|
|
|
Oh,I'm sorry, my english is poor, how to use the in-place editing of microsoft?
example: Microsoft Word and Microsoft Equation Eidtor(in the word), what do it? ,in the program use word
thank you
|
|
|
|
|
what are you talking about. You are in the wrong forum.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Hi, I have a problem when I want to use de XP/Vista Styles for Common Controls. As I'm using Visual Studio 2008, at the beggining of the code I put:
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
I read in the MSDN it is not neccesary add a manifest if I include that (if I use a manifest in XP the controls disappeard but the program works), but when I execute the program in XP, i get a error message, something like "Reinstallation of the program could solve the issue", on the other hand, in Vista works fine and the controls have the Vista style. ¿What is wrong?
Thanks
|
|
|
|
|
Did you call InitCommonControlsEx[^]? Aside of that, i believe "Reinstallation of the program could solce the issue" you usually get when your program uses a DLL the system cannot find...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|