|
"_$h@nky_" wrote: its works fine but its not move.
Which means what?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
How do i write to a text file with out erasing the previous data on the same text file
Dercio@C++
|
|
|
|
|
You should write it in append mode.
like in C++,
include<fstream>
std::ofstream ofs("mtfile.txt",ios::app);
ofs<<"Hi";
ofs.close()
ios::app says it's append mode. But just a question, Do you have a C++ book on hand?
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 the fopen function set the mode parameter to "a" or "a+"
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
why do we sometimes need to pass by reference, a parameter of a function
Dercio@C++
|
|
|
|
|
1.Passing by parameter ensures, you don't create multiple copies.
2.As you don't make copies, it saves memory and be faster.
3.When you change something to the reference, it would mean you are changing the actual object. So serves the purpose.
4. The same can be done using pointers, but reference are better in many ways. The major advantage is that you dont need to check for NULL every time.
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
|
|
|
|
|
Hello Dercio,
1) To avoid creating unnecessary temporary copy of variable while calling functions.
2) More user friendly method than pointers to get data back from functions. For instance
void GetString( CString& Value )
{
Value = "I've changed the value.";
}
...
CString csString;
GetString( csString );
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Dercio wrote: why do we sometimes need to pass by reference, a parameter of a function
I will answer that question for you if you will answer my question.
Q: Why do people sometimes need to ask questions in internet forums for which there are massive amounts of existing information on the internet and in books which they could choose to read?
|
|
|
|
|
Passing by reference is the sissy's way to pass a pointer.
--The Klingon Programmer
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]
|
|
|
|
|
Then what about reference to pointers? It's still sissy?
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
|
|
|
|
|
It's sissy's silly.
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]
|
|
|
|
|
Hi All,
I need the sample code for drag and drop between ListBox.
Pls help me........
Regards,
Anitha
|
|
|
|
|
Check Here^[^] Uses OLE.
Without OLE[^]
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
|
|
|
|
|
Did you time-warp completely past this?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am using PowerPoint automation to display PowerPoint file from my project. But sometimes the PowerPoint file is displaying behind my main application. How can I get the handle of the PowerPoint window from my project?
|
|
|
|
|
You can keep your application behind the ppt by using
this->SetWindowPos(&this->wndBottom,,,,,)
Also to get your ppt window, you can use FindWindow("WindowName",NULL);
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
|
|
|
|
|
_Application app;
app.CreateDispatch( "PowerPoint.Application" );
.........
SlideShowSettings m_pptSlideShowSettings;
.........
// Run the slide
m_pptSlideShowSettings.Run();
How can I get the handle of the running slide window?
What will be the "WindowName" name in the function FindWindow("WindowName",NULL);
|
|
|
|
|
Sorry for the typo that's the classname of the applicaiton. If you want to catch using the name displayed on the title bar, you should past it as the second argument.
Open a notepad, minimize it. Then run the below code:
HWND h = FindWindow(NULL,"Notepad");
ShowWindow(h,SW_MAXIMIZE);
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,
I would like to make a customized combobox.
My requirement is this: i want to add images beside the text in the combobox.For Example, combobox should contain list of countrynames and their flags image..
hope am making it clear.. if not, please click the following link for sample application
http://www.codeguru.com/cpp/controls/combobox/colourpickers/article.php/c1793[^]
Thanks,
Rakesh S
|
|
|
|
|
Understood your requirement, now what needs to be done?? now that you have got an sample project what are you waiting for?
|
|
|
|
|
They are actually adding an image like RGB values by using COLORREF..
Now my images are in my computer. what class should be called for to add those images in that RGB position?
Rakesh S
|
|
|
|
|
Check here[^]
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,
Its given for list control.. will it work if i just change it as combobox?
i am new to VC++.. please clarify it..
thanks,
rakesh s
|
|
|
|
|
Hello,
I have a project without document-view architecture. I added a (TableF)childframe derived from CMDIChildWnd and a (HeadView) childview derived from CView which is a member of childframe. When I execute, the childframe that is the window is been made properly with the view but the window gives debug assertion error while closing.
class TableF : public CMDIChildWnd
{
DECLARE_DYNCREATE(TableF)
protected:
TableF();
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual ~TableF();
HeadView Heading ;
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
DECLARE_MESSAGE_MAP()
};
class HeadView : public CView
{
//protected:
public:
HeadView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(HeadView)
public:
//Operations
public:
virtual void OnInitialUpdate();
//protected:
public :
virtual void OnDraw(CDC* pDC); // overridden to draw this view
public :
virtual ~HeadView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
}
The above are the view and frame classes.
|
|
|
|
|
To get better help, I strongly suggest you to read here before posting.
prithaa wrote: but the window gives debug assertion error while closing
Usually the error messages are quite informative: you should probably post the whole error message. Moreover it is a good idea to mark for us, in your code, the asserting line.
You should properly post code snippets using the code block button.
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]
|
|
|
|