|
prithaa wrote: I am getting error if I use the assignment operator.
This is very confusing. What kind of error ? A compilation error ? If yes, post the appropriate error message.
If it is a run-time error, then you should use your debugger to locate the problem.
|
|
|
|
|
My program is recording plain AVI file and i am looking for way to compress it.
(i don't need realtime processing) just to have opportunity to make file smaller from my program,
so far I produce gigabytes
Is there any free command line coder? (something like LAME or OGGENC for audio)
Or any C++ library for simple codec usage?
Thank you
viliam
|
|
|
|
|
look here
http://www.codeproject.com/audio/avitowmv.asp
Cheers,
Russell
|
|
|
|
|
You could have a look to VirtualDub sources[^]. And if it solves your problem, an article on how you did it would be welcome!
Society is composed of two great classes, those that have more dinners than appetite, and those who have more appetite than dinners
Fold with us! ¤ flickr
|
|
|
|
|
Hi all.
I want to make "BOLD"; the text from a static control.
How I can do this?
Thanks
Sameer Thakur
|
|
|
|
|
Have a look at LOGFONT-->lfWeight .
Set its value to FW_BOLD .
And use this font for static text.
|
|
|
|
|
1. Change the name of ID of Static Text from IDC_STATIC1 to some other name like ID_ST.
2. Declare a member variable of CFont, Say
CFont m_Font;
3. In OnInitDialog()
use CreateFont() function to create a font with bold attributes.
4. Call
GetDlgItem(ID_ST)->SetFont(&m_Font);
|
|
|
|
|
There is an example of this in the Extras section of this article.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all.
I need to change one character in CString :
Ex;
from
"C:\\My Folder\\*.exe"
to
"C:\\My Folder\\1.exe"
|
|
|
|
|
david bagaturia wrote: I need to change one character in CString:
Ex;
from
"C:\\My Folder\\*.exe"
to
"C:\\My Folder\\1.exe"
Use CString::Find and CString::SetAt ...
An Example...
CString csPath = _T( "C:\\My Folder\\*.exe" );
const int nLoc = csPath.Find( _T( '*' ));
if( nLoc != -1 )
{
csPath.SetAt( nLoc, _T( '1' ));
}
|
|
|
|
|
|
One Method:
Use Find and Replace methods of CString.
|
|
|
|
|
|
Hi,
I have an MDI Application with one DocTempate to handle .mpp files [My Program Files] added to it. Now I need to add one more doc template to it in order to open files of another extension, say *.mpj [My Project Files] so that when user double-clicks on .mpj files in explorer, my application can be asked to load that file. The problem is that, the data I am intending to store in .mpj files will be used to populate a tree control in one of the dialogs in my application. As a result, I do not have frame window and view classes for this file type. At present I am using the open menu option in my dialog to allow users to select/open/save .mpj files. But I want to add shell support to .mpj files so that I can open that file from explorer using my application.
How can I create and add one more DocTemplate that does not have a frame window and view class?
|
|
|
|
|
I want to add my program in context menu that pop-up when I right click at the file in windows explorer.
It same as right click at file and select scan virus software.
Please give me some idea for do this.
|
|
|
|
|
|
Michael Dunn wrote: clickety[^]
. Beaten by seconds[^].
|
|
|
|
|
Have a look at series of articles about shell extensions by Michael Dunn[^].
|
|
|
|
|
I have staring at my code for an hour now thinking of a suitable way to overcome this problem.
I have a class ( classA ) which has a static std::list of struct ( containg a classB pointer ) pointers as a member. The purpose of classA is to map any derived classes to an instance of classB depending on certain paramaters. Within the struct is a reference count of all the derived classes which are using an instance of classB.
class classA
{
typedef struct tagBATCHMAP
{
DWORD VertexType;
DWORD_PTR Texture;
classB* Batch;
UINT RefCount;
} BATCHMAP, *LPBATCHMAP;
public:
static void DeleteAll ( void );
static void CollectGarbage ( void );
protected:
classA ( void );
virtual ~classA ( void );
bool AddBatch ( DWORD dwType, DWORD_PTR dwpTexture );
UINT Release ( void );
private:
bool CreateInstance ( DWORD dwType, DWORD_PTR dwpTexture );
private:
static std::list< LPBATCHMAP > s_InstanceMap;
LPBATCHMAP m_BatchMap;
};
Since the BATCHMAP and ClassB are created dynamically, the CollectGarbage() method will delete any 0 referenced instaces at an appropriate time ( creating and deleteing are time consuming ). Everything works good and well until the DeleteAll() method is called ( which erases everything regardless of reference counts ) which is usually on program termination but may be called at any other time.
As you can see, classA holds a pointer to it's instance of classB ( again for timing reasons ). Once DeleteAll() is called this member pointer will be dangling. I can't think of a suitable way to overcome this.
|
|
|
|
|
And what is the problem exactly ? Because classA now holds a pointer that points to invalid memory ?
You said that DeleteAll is called at program termination, so what is the problem exactly ?
Anyway, what you could do, is to wrap your structure in a smart pointer. A smart pointer is a class that owns a pointer to a dynamically allocated object. It overload the -> and * operators so that you can use it as if you were using the nested object directly. The purpose of smart pointers is that they will destroy automatically the object as soon as nobody use it anymore. There is a reference counting in the smart counter and this ref counting is shared across all instances of the 'same' smart pointer (by same I mean the smart pointers that hold the same pointer). You can copy the smart pointer for example (this will increment the ref counting)...
There is a smart pointer class in the boost library. Take a look here[^] for a nice article about it.
|
|
|
|
|
Cedric Moonen wrote: You said that DeleteAll is called at program termination, so what is the problem exactly ?
I also mentioned that it could be called at any other time. classB manipulates the GPU memory directly, this memory could be lost at anytime upon which my program recieves a notification that all classB instances should be re-created.
I have just been reading an article about smart pointers. I think they are just what I'm looking for.
Thanks.
|
|
|
|
|
he he he nice article.. also auto_ptr do the same
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hello,
I have derived a class from CDBVariant
class Variant : public CDBVariant
{
CString m_strVal;
};
Now I have
vector<variant>myDataTable;
But if I try to add a member by writing
myDataTable.push_back(v); where v is of type Variant
then I get an error "Unhandled exception,Access violation"
do I have to write something about allocators when declaring vector<variant>.
I am not aware of allocators so do I need to learn them and use properly.
Thanks
Prithaa
|
|
|
|
|
Can you sow complete relevent code using pre tags ?
|
|
|
|
|
Hello,
I will not be able to write the code but these are few lines more in the code
class Variant : public CDBVariant
{
operator () <
operator () >
CString m_strVal;
};
Now I have
vector<Variant>myDataTable;
But if I try to add a member by writing
myDataTable.push_back(v); where v is of type Variant
then I get an error "Unhandled exception,Access violation"
Thanks for replying
Prithaa
|
|
|
|