|
Have you checked if Media Coder[^] could be of help to you?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
maybe check out "VLC" too.
|
|
|
|
|
http://en.wikipedia.org/wiki/Ffmpeg[^]
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
u can try total video converter. That might help u.
|
|
|
|
|
Hi, Here is singleton class. I have written destroy function to destoy the instance. But it is giving me error like test::~test' : cannot access protected member declared in class 'test'.
<br />
class test<br />
{<br />
protected:<br />
static test* m_instance;<br />
test(){}<br />
virtual ~test(){}<br />
<br />
public: <br />
static test* Instance()<br />
{<br />
return m_instance;<br />
}<br />
<br />
};<br />
test* test::m_instance = NULL;<br />
<br />
class test1 : public test<br />
{<br />
protected:<br />
test1(){}<br />
virtual ~test1()<br />
{<br />
destroy();<br />
} <br />
static void destroy()<br />
{<br />
if(m_instance)<br />
{<br />
delete m_instance;<br />
m_instance=NULL;<br />
}<br />
}<br />
public:<br />
static test1* instance()<br />
{<br />
if(!m_instance)<br />
{<br />
test:: m_instance = new test1();<br />
}<br />
return (test1*) m_instance;<br />
}<br />
<br />
void disp()<br />
{<br />
cout<<"hi"<<endl;<br />
}<br />
};<br />
<br />
int main()<br />
{<br />
test1::instance()->disp();<br />
return 0;<br />
}<br />
Pleae correct me where should I delete this instance.
|
|
|
|
|
I guess you are using VC6 ? This is a bug in the VC6 compiler. It is a very old compiler so I suggest that you upgrade to a more recent Visual Studio.
If you want to stick with VC6, make the destructors public, this should fix the problem.
|
|
|
|
|
|
I have a dialog box which in the OnInitDialog function scans for some system resources and performs a variety of checks to find those which match some criteria - those that match the criteria are added as text to a combo box on the dialog.
The dialog box then appears, with the combo box populated. The user can select a combo box entry and click the dialog's OK button (or Cancel button).
Because all of the checks are done in OnInitDialog, the dialog box does not appear at all until all of the checks are complete. There is only a brief delay in the dialog's appearance on a fast PC, but on older PCs the delay may make the user think nothing is happening.
I think what is needed is for the dialog to appear immediately with a "Scanning resources..." message written on the dialog, and the OK button disabled. The resources are then checked (I'm not sure which function where this could be done) and when complete the combo box is populated and the OK button enabled.
It would be good to allow the user to click the Cancel button while the resource checking is being performed, and this would stop the checking immediately and close the dialog box. This suggests that the resource checking should be done in a separate thread so that the Cancel button would be immediately responsive.
Is there an off-the-shelf CDialog based class available which does this or something similar?
If not, what CDialog function would be the correct place to put my resource checking. It would have to run AFTER the dialog has been fully painted.
|
|
|
|
|
Start a separate worker thread in OnInitDialog, passing to the thread (among other things, probably) the HWND of the dialog, and let OnInitDialog return. Do your work in the thread procedure, and post a message back to the dialog (that's what the HWND is for) to tell the dialog to redraw itself with the new information.
Don't forget to handle the case where the user closes the dialog while the worker thread is still running.
|
|
|
|
|
|
Thanks Graham and Michael. I was aware of the peekmessage technique of checking for the cancel button being pressed and processing GUI messages. Graham's outline is how I had thought I'd have to do it.
It struck me that this sort of thing could be a frequent requirement - i.e.
- immediate appearance of dialog box displaying "please wait while scanning..."
- processing of data that takes several seconds
- controls then updated with data (and the please wait message removed)
- Cancel button stops processing and closes dialog immediately (no user-perceived delay)
and that someone may have written a CDialog derived class already.
|
|
|
|
|
Done, using Graham's outline. Thanks ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Hello everyone,
When using GetRecordInfoFromGuids to get record info from a typelib from an application, we only need to correctly supply the LIB ID (1st parameter to the function), and the function will automatically finds related typelib by the LIB ID in from Windows registry? No need to manually copy the typelib to the application current directory or manully copy somewhere else?
http://msdn.microsoft.com/en-us/library/ms221025(VS.85).aspx
I have tested it is fine just to supply the correct LIB ID, no manually copy is needed. But since my experience of using this API is limited, your confirmation and comments are appreciated.
thanks in advance,
George
|
|
|
|
|
Hi,
I'm going to conncect to a database file (Database#1.mdf) which I need to connect to directly. (Specifying the mdf file name in the connection string).
Can you provide a code that uses OLE DB to connect to the database?
the database is created in Solution explorer pane of visual studio and the created mdf file is stored somewhere in c:\Database#1.mdf.
Thanks.
|
|
|
|
|
Hi all,
I want to write a buffer content into a ostream. So I try this.
<br />
int CopyBufferTo(ostream& str;)<br />
{<br />
char writeBuffer[100] = {0};<br />
str.write(writeBuffer, 200);<br />
<br />
return 0;<br />
}<br />
Is that fine. I print the stream to console, and I can see the expect output. But then I want to attach as follows,
int AttachTo()<br />
{<br />
stringstream str(ios::in|ios::out|ios::binary);<br />
if(CopyBufferTo(str) == 0)<br />
{<br />
char test[256] = {0};<br />
sprintf(test, "%s", str.str());<br />
memcpy(400, buffer, 200);<br />
}<br />
}
I hope it's clear to you, after attaching the stream to buffer it contain part of it. Not the output on console. Can you help me to find where I'm going wrong.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: char writeBuffer[100] = {0};
// Do the processing on buffer
str.write(writeBuffer, 200);
Shouldn't the second argument to write() match the size of writeBuffer ?
CodingLover wrote: char test[256] = {0};
sprintf(test, "%s", str.str());
What happens if str is larger than 256 characters?
CodingLover wrote: memcpy(400, buffer, 200);
Do you have a variable named 400 ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I know .NET framework and C# well. Recently I started working with C++/CLI which I felt more interesting than C#. Since .NET framework is becoming popular, do you think MFC got obsolete? Are you guys doing any projects in MFC other than maintaining the legacy applications?
I don't know MFC and I would like to know whether learning MFC is worth now?
|
|
|
|
|
Christian Flutcher wrote: Is MFC obsolete?
NO, it is NOT !
there's nothing better than native C++ coding !!!
|
|
|
|
|
toxcct wrote: NO, it is NOT !
True.
toxcct wrote: there's nothing better than native C++ coding !!!
Absolutely true.
Anyway, the two sentences are...unrelated.
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]
|
|
|
|
|
Of all your questions I've attempted, this is the toughest one, Christian.
First off, .NET and C++ (I will say only C++ in this message. But, When I say C++, include the frameworks and libraries built on and around it - MFC, ATL, WTL, etc.,) are entirely two different things. They exist to solve different problem sets and they cater to different consumers.
During the old days, there was not much of anything more than C/C++. There was another language known as VB, which was catering to an entirely different mass of programmers. VB was too easy to learn, someone quoted "as easy as falling a flight of stairs". But it had several drawbacks, which I won't be listing up here.
So, C/C++ was the prominent choice if you wanted to build high quality, efficient programs. Then the .NET framework came along, which introduced a lot of new features, which would be very difficult if you were to achieve that with C++.
So, the world witnessed a whole new array of fresh .NET programmers (programming became easy) and another mass of C++ guys shifted to .NET, even the "Big Dogs" of the C++ game (some of them being passionate towards technology, wanting to learn the new stuff, some other moved because .NET was easier to do and was the upcoming trend). With the days, .NET has grown to be a true giant, and is the choice for developing large scale business applications which usually involves networking, databases, client/servers, dynamic web-pages, etc.
As you've come from .NET background, I don't have to explain you how good is .NET while dealing with these things. It is the absolute gun, and C++ is no rival. But don't forget it: What .NET can do, C++ CAN do, faster, with lesser dependencies and cripples, lesser resources. But the cost and time of production will increase logarithmically and you will have to do a LOT of work yourself.
For example, when I had to write a server program that will be running 24x7, I wrote it in C#. Why? Because I don't have to bother about garbage collection or a remotest possible memory damage bug or memory fragmentation. But, when I had to write a program that will interpret bytes from a semi-intelligent terminal, before that is sent to the printer port and do some real-time processing on the buffer, I wrote it in C. Why? Because performance is of paramount importance there (read the word real-time?)
When it boils down to system side programming (desktop application development, device drivers, writing new funky frameworks like - uh... .NET, etc.,), C++ is the absolute choice. May I rephrase? Native programming and Managed programming exist for different purposes, so, they must be used wisely and appropriately.
And to talk about the opportunities, sadly the market for C++ devs are comparatively less (when compared to .NET), but is NOT DEAD, NOT OBSOLETE. And will never die.
[added] We, a lot of Visual C++ developers had been discussing this with MS that no significant amount of development was put by MS for the betterment of native language programmers. MS pretty much agreed on the point and gave us a very favorable reply (there's a lot of non-disclosure stuff that I cannot disclose here legally). They also released feature pack for Visual C++ 2008[^], which has improved the features of the MFC framework tremendously. MS has clearly stated that their next version of Visual Studio will bring in a host of improvements for the C++ developers. [/added]
Theese C++ guys are the true Gurus, true Geeks. I say it because they prove it over and over, beyond any shadows of doubt, by creating technology (like .NET) that will be mass-consumed.
Christian Flutcher wrote: I know .NET framework and C# well.
There is no C++ vs .NET argument that would be of my least interest, but please don't forget this: "My compiler compiled your compiler".
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Got my 5 for this, Rajesh!
|
|
|
|
|
Thanks pal.
Unfortunately there is a lot of MVP NDA stuff, which I cannot legally disclose. Otherwise, I could have put forward a lot of points to prove that the future plans of MS shows how much they respect Windows Programmers and that they've taken our betterment very seriously.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
WOW! that's a wonderful post. I appreciate your effort.
Rajesh R Subramanian wrote: Theese C++ guys are the true Gurus, true Geeks
Rajesh R Subramanian wrote: Please don't forget this: My compiler compiled your compiler.
I understand and truly regret for not studying it so far. But I am on the track and expecting to be a small geek very soon.
I have finished the "Thinking in C++" book suggested by you. No second thoughts, it was a great read. BTW, do you have any MFC book suggestions?
Thanks again.
|
|
|
|
|
|
I will check those books. Thanks Rajesh ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|