I am working with MFC VC++6 and want to read a file that I created and
display the contents of the file to a message box. The file has one
character 'a' at position 1.
Here is my code:
const int MAX_STRING_LENGTH = 10;
MyFile.Open("...MyfilePath", CFile::modeNoTruncate | CFile::modeRead );
char* TempBuf = MyString.GetBuffer(MAX_STRING_LENGTH);
UINT NumChars = MyFile.Read((void FAR*) TempBuf, MAX_STRING_LENGTH - 1);
Unfortunately I get an exception error. Does anyone know what I am doing
w...average with exception of some cells?
How can I exclude a few cells in calculating the average, maybe if it
has color or whatever the best way to distinguish it from the rest?
I can probably manually delete them first, write down the average,
revert to previous, but it is not automatic.
Values in A1:A10, in column B you can mark values to exclude from the
calculation with an 'x', and use this formula to calculate the average:
"cpliu" <firstname.lastname@example.org> skrev i meddel...Office (except Entourage) does not start after Updating to Panther.
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
Content-type: text/plain; charset="ISO-8859-1"
After trying to start any of the office programs under X 10.3, i only get
the start-window and the spinning wheel. After a little while i get an error
message, the program could not be started.
I tried to update to versions 10.1.4 an 10.1.5 (only excel and powerpoint),
I also repaired my disk permissions...
I have another office-cop...help cfile
I have a simple question
This is what i have
char* pFileName = "C:\\newspaper\\b run\\text.txt";
CFile f( pFileName, CFile::modeCreate | CFile::modeWrite );
CString out =(buff2+ current->address);<- right here i would like a return
what i would like to know is how do i advance to the next line
I have tried
CString out = (buff2+ current->address+"\n");
well mabe i just have to revert back to the ofstream then cout << endl
&quo...Formula to show numbers except two
I have this data in column A that changes each time.
I have only the first 2 numbers that go from 10 to 17. I need a
formula that from A3 on throws all the numbers from 10 to 17 except
the first two. For example, in this case, I have numbers 10 and 15,
the formula should show:
If I had 12 and 17, it shoul show 10, 11, 13, 14, 15 and 16. Hope my
question is clear.
Will the 2 numbers ever be the same:
A1 = 17
A2 = 17
Will the the 2 numbers *always* be listed in ascending order? Will this ever
be a possi...delete and exception
I have a problem with a delete and I am trying to know what kind of
delete  pArray2Flush;
catch ( ...)
????? How can I know the exact exception
"mosfet" <email@example.com> wrote in message
> I have a problem with a delete and I am trying to know what kind of
> delete  pArray2Flush;
> catch ( ...)
> ????? How can I know the exact exception
If you want to write proper C++, the destr...CFile
i want to read the contents of a text file and to replace
the occurance of a particular word. i have used CFile.read
and the contents of the file is stored in a character
variable,say buffer. now how can i search for a word
and replace it.
Use CStdioFile and read each line into a CString variable. Then use
CString:Replace() to find the word and replace.
Check Abdoul [ VC++ MVP ]
"anu" <firstname.lastname@example.org> wrote in message
> i want to read t...Exception thrown inside AfxWndProc
I've had a dump file that have the following call stack.
Basic what is happening is that inside CapPRGStatic::showUp(), function
CWnd::MoveWindow() is called, which generats a window message WM_WINDOWMOVING
which is send to AfxWndProcDllStatic for processing.
The direct cause of the exception is inside function (MFC4.2)
AfxWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
// special message which identifies the...Serialize CFile
Hi, May I know is it possible to serialize a CFile object in CDoc? If
so, how can I do it? I have tried to create a CFile m_file in CDoc,
then in Serialize, call m_file.Serialize(ar). But it seems like nothing
is saved. Pls enlighten, thank you.
<email@example.com> wrote in message
| Hi, May I know is it possible to serialize a CFile object in CDoc? If
| so, how can I do it? I have tried to create a CFile m_file in CDoc,
| then in Serialize, call m_file.Serialize(ar). But it seems like nothing
| is saved. Pls enlighten, t...Importing text file into Excel 2003 - C#
I am a newby in Excel programming so my question could be an easy one.
I found lots of VB code snippets on this issue but almost none in C#.
I want to import in a new Excel 2003 doc a character delimited text
Here is my code:
Excel.Workbook lWB =
Excel.Worksheet lWS = (Excel.Worksheet)lWB.ActiveSheet;
string myfilename = "TEXT;C:\\tmp\\test.txt";
Excel.Range lRange = lWS.get_Range("A1","A1");
/////// the following call generates: System.ArgumentException - The
I Open a file using CFile::Open() in read mode.
To read from file, we use CFile::Read()
If i want to read file in an int type array then how can i do it?
suppose CFile myfile;
if( !myfile.Open( path, CFile::modeRead ||CFile::shareDenyWrite , &e ) )
is this correct?
>I Open a file using CFile::Open() in read mode.
>To read from file, we use CFile::Read()
>If i want to read fil...New exception in IE7 + CWebBrowser2::Navigate()?
Hi everyone! I have a program that uses the IWebBrowser2 ActiveX
control, and since I installed IE7 on my system, I've been seeing some
new and unwelcome behavior. Specifically, if my program starts when I
don't have an internet connection available, my program will display a
popup window with the text:
Cannot find [URL]. Make sure the path or Internet address is correct.
and crash. I can only assume that dialog is coming from IWebBrowser2,
since it's not in my code, and it only started showing up after IE7
was installed. The dialog needs to be squelched (I have my own error
...Exception while exporting data from .net to excel 2003 using sqlse
Application : C#.Net, Windows application
BackEnd : SqlServer2000
Excel : Ms-Excel 2003
We have a situation where our data is not exporting from C# windows
application to Ms-Excel 2003.we have found that our application cannot load
data into excel more than 911 characters in a cell,If i add 1 character more
to this group of 911 characters,then i receive this "Exception from
HRESULT:0x800A03EC" exception message.so please tell me do u can help me out
with any solution,or any patches of microsoft will help us.
...Archiving: Can archive any folder except the Inbox itself
I am able to select any folder or group of folders in my PST file for
archiving, including any and all subfolders *within* the Inbox, but cannot
archive the Inbox itself. Attempting to do so raises the single-sentence
error, "Error while archiving folder 'Inbox' in store 'Personal Folders.'"
I've repaired my PST file multiple times, and everything else works without
a problem. Is it possible that I've exceeded some limit for nested folders,
or total number of items? The process seems to fail before it even starts.
Thank you very much!
Drag/dro...Exchange 2003 cannot access system Manager (throws MAPI32.dll Q266418 error Popup)
Thank You for reading my post.
We have SBS2003 with Exchange Server. For some time now, whenever I attempt
to use the Exchagne System Manager, it fails to load, throwing an error
dialog box which reads...
Exchange System Manager.
Exchange detected that "c:\windows\system32=MAPI32.DLL" is not the
correct versin required to run Exchange System Manger or Exchange Server
2003. This may cause failures in Exchange System Manager, affect
availability of your server, or both. For more information see Microsoft
Knowledge Base article Q266418 at http://support/microsoft.com
The...CFile does not throw exception.
I am using CFile class to do file reading and writing operation. I use
the following codes to catch a CFileException when open up a file:
// Then write code to abort operation
This code will catch the file access violation exception, meaning that
when the target file is already opened, then CFile::Open(,,,) will
return FALSE and the code will report error.
But, when there is no "c:\1.txt" file exists, the apllication will have
a run time err...How to refer to a range except one cell
I'm trying to average a range except one cell in the middle of that range
(or alternatively to condition on a range made of two separate sections). The
formula I'm trying to use is the following:
=IF(AND(B$47>0, B$53=2), B$47-AVERAGEIF(B$45:B$50, ">0"), "-")
Except, instead of B45:B50 in AVERAGEIF, I want the range to be B45:B46 and
B48:B50 (i.e. without the cell B47).
Can anyone tell me how to use a split range with AVERAGEIF or how to tell it
not to look at cell B47?
Grateful for any advice. Thanks!
Just use some helper cells:...Unhandled Exception
When I try to add a new product, I get the following message:
<description>The specified object was not found.</description>
I checked to make sure that the description field was there.
What could be wrong?
Have you made any customizations to the system? Checking the event log
on the Event Viewer (on the server) could also help you try to find
out what happened.
Leo Lopes @ L3
I know this can be done by header/footer, but I am trying to put the logo on
the right side of the page. I can do this manually, basically copy and paste
the logo (which I have made using the auto-shape feature), but they don't
appear in the exact same location on each page and I have to play with it a
Anyway to have this 'logo box' to appear on every page of the report (except
for teh first page) automatically?
Enable "Different first page" and then anchor the logo to the primary Header
(omitting it from the First Page Header). Header content can b...Having Problems with CFile
Hello I am new at this . But CFile is giving me trouble. I got visual
studio 6 and . The CFile is in a function. that starts a file that
will be a report file. The program compiles ok, but runs and gives a
debug error and crashes help
// begin Report function
Problem is you didnt give permission to write while opening the file
(CFile::modeCreate | CFile::modeWrite).
I'm tring to write 3 lines to a text file using CFile::Write. I need a carriage-return between each line but don't seem to be able to achieve that. This is my code
mac.Open("macro.txt", CFile::modeCreate | CFile::modeWrite)
when I then open the file with notepad, the carriage return "\n" the carriage return just give me a f...VB to delete columns except these...
I have an Excel worksheet called "Sheet1" and I am looking for a way to
automatically delete all columns in Sheet1 that are not named "Test1" and
Test2". Can someone assist?
Can you describe what you mean by "columns...not named"? Do you mean
"Defined Names"? Or perhaps header text (in Row 1 I presume)? Or did you use
the word "named" in a general context meaning those text strings as cell
values in some particular (unspecified) column? Or something else entirely?
Rick (MVP - Excel)
&quo...how do I send email + attachment to several recipients except one
I am using Outlook to send an email with an attachment to several recipients.
But one of the recipients does not want to receive the attachment. She only
wants the text message but not the file. How do I do this? Thanks (my Outlook
version is 2003)
You'll need to send a separate email without the attachments.
"aml.rofso" <firstname.lastname@example.org> wrote in message
:I am using Outlook to send an email with an attachment to several
: But one of the recipients does not want to re...C00D11BA error code no sound except through MagicJack
I lost my internet connection 5pm, called ISP and was told about fiber
optics breach, wait 3 hr. decided to watch movie, no sound, tried itunes,
then WMP music NO SOUND. At 9:30 back online, no sound. I picked up phone to
call ISP and could hear everything through phone during call to ISP and they
had no answer so I spent 2 1/2 hrs. with MagicJack live chat to no avail.I
had to hold the phone to my head to to watch Keith Olberman and Rachel
Maddow, but that ain't gonna work for me. I still get all sound through phone
but not computer or speakers. I do not have CMedia AC97 in...CFile:Read
Hi Team :
I want to read a text file, with the next sample code:
UINT nActual=0;char szBuffer;
Only read the first part of the text file, Do you have some tips related to
this issue ?
Thanks in advanced,
Why not just use ReadString instead and read one line at a time into a
CString? That's the easiest way to use CStdioFile.
"German" <German@discussions.microsoft.com> wrote in message