|
If you try to build this source code in a VC-version later than 1.52, you won't succeed, since this is a very old, 16 bit DOS program.
I would suggest you to start a new project (in a more recent version of VC++), then cut and paste the useful parts to the new project.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I am trying to open a new file using Append mode in C++. But file is not opened. If I use out mode, file is opened.But the problem is:
The data I entered once is lost during the next execution. I don't want the data to be lost. How to achieve this in C++.
Is there any specific mode in C++ for this?
|
|
|
|
|
You haven't said what you're using for file handling.
Are you using WIN32 handles, stdio FILE*, or STD streams?
Steve S
Developer for hire
|
|
|
|
|
fstream ofs("studfile.txt",ios::out);
This is the statement I'm using to open the file. If I use app in place of out, the file is not opened. But I want the contents of the files don't get erased after each execution.
|
|
|
|
|
T.RATHA KRISHNAN wrote: If I use app in place of out...
Why aren't you using both?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Steve S wrote: ...or STD streams?
STL?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
open the file in apppend mode...
syntax...
modes for opening a file----->
fstream file_op("C:\\s1.txt ",ios::out|ios::app);
|
|
|
|
|
Thanks Mani. It's working.
|
|
|
|
|
|
Hi all,
I am trying to use IActiveDesktop interface in my code.
I have included
#include "shlobj.h"
and defined this in stdafx.h
#import "shell32.dll"
but it is giving error
error C2027: use of undefined type 'IActiveDesktop'
how to resolve this
Can anybody help me in this
thanks in advance
|
|
|
|
|
You could try
#include <wininet.h>
#include <shlobj.h>
as I believe there are things in shlobj.h that rely on wininet.h being included first.
After that, you might also consider that by default, #import generates definitions inside a namespace, so if that was where IActiveDesktop was being defined, it wouldn't be in the global namespace.
You can look at the generated tli/tlh files to see what the namespace is called.
Steve S
Developer for hire
|
|
|
|
|
|
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanku all,
it solved my problem....
|
|
|
|
|
Hi everybody,
like some times before i have a very strange behavior:
I add lines to the header : Error
I switch some lines : No Error
Now i have a same case:
class MyView
{
DECLARE_DYNCREATE(.....
public:
MyView(....
~MyView();
public:
enum { IDD = IDD_MY_VIEW };
#ifndef _DEBUG
...
#endif
public:
virtual void DoDataExchange(...
DECLARE_MESS...
CFontStatic lbInfo;
CButton btOk;
CSxGroupBox gbSelect;
CFontStatic lbOne;
CFontStatic lbTwo;
CFontStatic lbThree;
CFontStatic lbFour;
i get an error during the SubClassing of lbOne during DoDataExchange
CFontStatic lbInfo;
CButton btOk;
CFontStatic lbOne;
CFontStatic lbTwo;
CFontStatic lbThree;
CFontStatic lbFour;
CSxGroupBox gbSelect;
NO ERROR
CSxGroupBox gbSelect;
CFontStatic lbInfo;
CButton btOk;
CFontStatic lbOne;
CFontStatic lbTwo;
CFontStatic lbThree;
CFontStatic lbFour;
I get an error during AfxCallWndProc
CStatic gbSelect;
CFontStatic lbInfo;
CButton btOk;
CFontStatic lbOne;
CFontStatic lbTwo;
CFontStatic lbThree;
CFontStatic lbFour;
If i replace CSxGroupBox with CStatic i also get NO ERROR
i don't really understand how this effect occurs.
The View "MyView" does nothing, no char array which could overflow
And there are also no other views/funtions before the opening of this MyView
which manipulates arrays or other operations which could provoke an overflow
Does any one know the problem or has some times the same effect?
Big thanks !
|
|
|
|
|
Just a guess but I'd say CSxGroupBox is overwriting memory that doesn't belong to it, probably in the constructor. That's where I'd look to start with.
Just a tip: Calling your post VS.NET error makes it sound like a problem with .NET which belongs in the .NET forum or a problem with Visual Studio which belongs in the Visual Studio forum. This might explain the slight lack of response. Dialog crashes in DataExchange or C++ Subclassing problem might have been more appropriate.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Ok, i will check the code of CSxGroupBox
Thanks for your help
|
|
|
|
|
hi i am copying a file to user desktop. the user should not edit or open or delete the file. how to do this in mfc.
-- modified at 7:17 Thursday 21st June, 2007
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: how to do this in mfc.
Change the file's access permissions via the ACL. The solution has nothing to do with MFC.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have a project used CFileDialog, the icon color is just 16 colors, but in another project it is 256 color icon.Does anyone know how to make CFileDialog to show 256 color icon?
Thanks!
|
|
|
|
|
What icon? CFileDialog wraps the Windows common file open/save dialog. What icons are involved
with that?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
What I mean is the toolbar button: Up One Level, Create New Folder and View Menu button.These buttons are 16 colors, but in office word, excel they are 256 colors.
|
|
|
|
|
The dialog in Office is customized. For info on customizing these dialogs, see
Open and Save As Dialog Boxes[^]
I'm not sure how much is documented about changing the explorer-style dialogs, especially the
toolbar.
On XP, if you add themes to your app with the appropriate manifest, you'll get the look identical
to the file/open dialog in IE...see
Add Windows XP Theme Style to your current projects[^]
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
Hi everyone,
Is there any API to determine whether the given IPAdress belongs to public or private network. I have used the IPAdress series to determine the type of network,now i'd like to be more specific as far as the API is concerned.
thanks in advance...
sasi...
|
|
|
|