Problem with handling division by zero exception

This may not be the right group, so if you know of a better one, please 
direct me to it.

The code below (I'm showing just the relevant parts, no class definitions) 
is intended to turn division by 0 (DBZ) structured exception into C++ 
exceptions, and it works almost well.

The way it works: first I call install which sets my_translator as the 
structured exception handler, then when the DBZ happens, I re-throw it as a 
C++ DivideByZeroExceptionImpl.

Note the calls to _controlfp in install to enable DBZ error in the FPU and 
_clearfp to clear the exception after it was caught.

The only problem I have with this is that starting after the first 5 or so 
such exceptions, after each C++ exception is caught, the first division 
operation, no matter where in the code or what the operands, will result in 
a NaN (Not a number) result. So to avoid this, I first perform a dummy 
division then I continue the code normally. My understanding was that the 
call to _clearfp would take care of any such problem.

All this is done using Visual Studio .Net 2003, and all the compiler options 
that have to do with this are set properly (/EHa).

Any idea why this is happening and how to avoid it?

Related to this, I am puzzled by two other issues:
- why isn't it floating point DBZ exception enabled by default? IMO it is a 
runtime error almost as serious as an access violation that must be handled 
in most cases.
- why isn't a std::runtime_error exception thrown in case of a DBZ error? 
Can this be enabled?


////////////////////////////////
void my_translator(unsigned code, EXCEPTION_POINTERS *info)
{
  switch ( code )
  {
  case EXCEPTION_INT_DIVIDE_BY_ZERO:
  case EXCEPTION_FLT_DIVIDE_BY_ZERO:
   {
  _clearfp();

   }
    throw DivideByZeroExceptionImpl(*info);
    break;
  default:
    throw StructuredException( UNKNOWN_STRUCTURED_ERROR, *info);
    break;
  }
}

void StructuredException::install() throw()
{
  int _cw;
  _cw = _controlfp( 0,0 );

  // Set the exception masks OFF, turn exceptions on.
  int cwx = _cw & ~(EM_ZERODIVIDE);

  // Set the control word.
  _controlfp( cwx, MCW_EM );

  _set_se_translator( my_translator );
}


// C++ DBZ exception handler

try
{
....
}
catch( const DivideByZeroException& e )
{
   // dummy division
   double xxx = 5/10;

   // continue the handler
}
//////////////////////////////////////


Thanks,

a 


0
xxxxxxx (5)
12/7/2007 3:07:11 PM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
765 Views

Similar Articles

[PageSpeed] 7

On Fri, 07 Dec 2007 15:07:11 GMT, "a" <xxxxxxx@pacbell.net> wrote:

>This may not be the right group, so if you know of a better one, please 
>direct me to it.
>
>The code below (I'm showing just the relevant parts, no class definitions) 
>is intended to turn division by 0 (DBZ) structured exception into C++ 
>exceptions, and it works almost well.
>
>The way it works: first I call install which sets my_translator as the 
>structured exception handler, then when the DBZ happens, I re-throw it as a 
>C++ DivideByZeroExceptionImpl.
>
>Note the calls to _controlfp in install to enable DBZ error in the FPU and 
>_clearfp to clear the exception after it was caught.
>
>The only problem I have with this is that starting after the first 5 or so 
>such exceptions, after each C++ exception is caught, the first division 
>operation, no matter where in the code or what the operands, will result in 
>a NaN (Not a number) result. So to avoid this, I first perform a dummy 
>division then I continue the code normally. My understanding was that the 
>call to _clearfp would take care of any such problem.
>
>All this is done using Visual Studio .Net 2003, and all the compiler options 
>that have to do with this are set properly (/EHa).
>
>Any idea why this is happening and how to avoid it?

Sorry, no.

>Related to this, I am puzzled by two other issues:
>- why isn't it floating point DBZ exception enabled by default? IMO it is a 
>runtime error almost as serious as an access violation that must be handled 
>in most cases.

All floating point exceptions are masked by default, and unlike the case
with access violations, you can inspect the FPU status word at any time to
see if a floating point error has occurred at some point in the past. In
addition, floating point errors tend not to corrupt the overall state of
the program.

BTW, the correct "handling" of access violations in nearly all cases is to
do nothing, particularly not to interfere with the system. For more on
this, see:

http://members.cox.net/doug_web/eh.htm

>- why isn't a std::runtime_error exception thrown in case of a DBZ error? 
>Can this be enabled?

No, it cannot be "enabled", except by using _set_se_translator. It isn't a
standard part of C++, because low-level errors such as this are handled in
various system-specific ways, to (loosely) quote Stroustrup (by distant
memory) in "The Design and Evolution and C++".

One problem with FP exceptions is that they are somewhat asynchronous. That
is, an FPU exception tends not to be raised until a subsequent FP
instruction is attempted. I concluded a long time ago that FP exceptions
are far more trouble than they're worth. It's almost always sufficient to
check the FPU status at the end of a calculation. Due to the asynchronous
nature of FP exceptions, you have to do this anyway (or something
equivalent) to ensure any pending FP exception will be raised.

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
12/7/2007 5:29:14 PM
Thanks for your reply.
>
> Sorry, no.
>
>>Related to this, I am puzzled by two other issues:
>>- why isn't it floating point DBZ exception enabled by default? IMO it is 
>>a
>>runtime error almost as serious as an access violation that must be 
>>handled
>>in most cases.
>
> All floating point exceptions are masked by default, and unlike the case
> with access violations, you can inspect the FPU status word at any time to
> see if a floating point error has occurred at some point in the past. In
> addition, floating point errors tend not to corrupt the overall state of
> the program.
>
> BTW, the correct "handling" of access violations in nearly all cases is to
> do nothing, particularly not to interfere with the system. For more on
> this, see:
>
> http://members.cox.net/doug_web/eh.htm

Good article, thx.

Ok, let me rephrase - what I meant is that that these errors can't be 
ignored, if just to catch and fix the bugs that caused them. In my case it's 
even more important to handle them (see below).

>
>>- why isn't a std::runtime_error exception thrown in case of a DBZ error?
>>Can this be enabled?
>
> No, it cannot be "enabled", except by using _set_se_translator. It isn't a
> standard part of C++, because low-level errors such as this are handled in
> various system-specific ways, to (loosely) quote Stroustrup (by distant
> memory) in "The Design and Evolution and C++".

To me the purpose of runtime_error is to hide platform specific details 
behind a standard interface, so other than maybe techinical issues that 
can't be overcome, I don't see why this exception class couldn't 
conceptually be used to signal a division by 0 condition. In fact I think 
the opposite is true - how division by 0 is managed or thrown internally, 
and whether it's synchronous or not it's irrelevant at the application 
level, and if the app needs to handle that exception, it should be able to 
in a simple and standard way.

>
> One problem with FP exceptions is that they are somewhat asynchronous. 
> That
> is, an FPU exception tends not to be raised until a subsequent FP
> instruction is attempted. I concluded a long time ago that FP exceptions
> are far more trouble than they're worth. It's almost always sufficient to
> check the FPU status at the end of a calculation. Due to the asynchronous
> nature of FP exceptions, you have to do this anyway (or something
> equivalent) to ensure any pending FP exception will be raised.

In my case, the code that may throw these exceptions is located in 3rd party 
defined plug-ins and not under my control, therefore I need to catch any 
runtime errors to avoid crashing the whole application if one module is 
buggy.

Regards,

a 


0
xxxxxxx (5)
12/7/2007 10:02:35 PM
On Fri, 07 Dec 2007 22:02:35 GMT, "a" <xxxxxxx@pacbell.net> wrote:

>To me the purpose of runtime_error is to hide platform specific details 
>behind a standard interface, so other than maybe techinical issues that 
>can't be overcome, I don't see why this exception class couldn't 
>conceptually be used to signal a division by 0 condition.

For those platforms that actually have FP exceptions, it could, but as it
isn't standardized, it would be very surprising, and it would be a really
bad idea for a vendor to do it. Conceptually, it's arguably more of a
logic_error than a runtime_error, because you can easily avoid it without
trying it.

>In fact I think 
>the opposite is true - how division by 0 is managed or thrown internally, 
>and whether it's synchronous or not it's irrelevant at the application 
>level, and if the app needs to handle that exception, it should be able to 
>in a simple and standard way.

It's very relevant, because architectures differ widely in how they deal
with division by zero and the other low-level system events Stroustrup left
out of C++. Whether or not it's synchronous is also relevant, because if
you have the sequence:

   f();
   g();

It would be highly unusual for an error that actually occurred in f() to be
reported by unrelated code in g() throwing an exception. To solve this
problem on x86, you need to do something like this:

   f();
   __asm fwait;
   g();

Since you have to "poll" exceptions to ensure pending ones are raised, the
only advantage I see to enabling them in the first place is to ensure a
long-running calculation is interrupted as soon as possible. If that's not
an issue, then leaving FP exceptions masked and polling the status word is
sufficient.

>In my case, the code that may throw these exceptions is located in 3rd party 
>defined plug-ins and not under my control, therefore I need to catch any 
>runtime errors to avoid crashing the whole application if one module is 
>buggy.

That's not what C++ exceptions are for. In general, crashing the whole
application is the desired result of a buggy plugin corrupting a program's
state in unknown ways. Also, who's to say you won't interfere with a plugin
that assumes FP exceptions are left in their default state, masked?

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
12/7/2007 10:42:33 PM
What I did was use code of the form
	if(_isnan(fp))
	    throw new CFloatException(_T(__FILE__), __LINE__);
where I derived
class CFloatException : public CException {
     public:
         CFloatException(LPCTSTR file, int line) { ...stuff here...}
     ...
};

I did this in an interpreter we built, so the points at which a NaN could occur were
well-defined.

Some architectures like the Intel 960 would throw an FP exception only after seven other
FP instructions managed to push the result through the FP pipeline.  The compiler for that
architecture was a nightmare (a good friend of mine wrote the code generator for the Ada
compiler for that architecture...some of his code landed on Jupiter, and some in Baghdad)
				joe

On Fri, 07 Dec 2007 16:42:33 -0600, "Doug Harrison [MVP]" <dsh@mvps.org> wrote:

>On Fri, 07 Dec 2007 22:02:35 GMT, "a" <xxxxxxx@pacbell.net> wrote:
>
>>To me the purpose of runtime_error is to hide platform specific details 
>>behind a standard interface, so other than maybe techinical issues that 
>>can't be overcome, I don't see why this exception class couldn't 
>>conceptually be used to signal a division by 0 condition.
>
>For those platforms that actually have FP exceptions, it could, but as it
>isn't standardized, it would be very surprising, and it would be a really
>bad idea for a vendor to do it. Conceptually, it's arguably more of a
>logic_error than a runtime_error, because you can easily avoid it without
>trying it.
>
>>In fact I think 
>>the opposite is true - how division by 0 is managed or thrown internally, 
>>and whether it's synchronous or not it's irrelevant at the application 
>>level, and if the app needs to handle that exception, it should be able to 
>>in a simple and standard way.
>
>It's very relevant, because architectures differ widely in how they deal
>with division by zero and the other low-level system events Stroustrup left
>out of C++. Whether or not it's synchronous is also relevant, because if
>you have the sequence:
>
>   f();
>   g();
>
>It would be highly unusual for an error that actually occurred in f() to be
>reported by unrelated code in g() throwing an exception. To solve this
>problem on x86, you need to do something like this:
>
>   f();
>   __asm fwait;
>   g();
>
>Since you have to "poll" exceptions to ensure pending ones are raised, the
>only advantage I see to enabling them in the first place is to ensure a
>long-running calculation is interrupted as soon as possible. If that's not
>an issue, then leaving FP exceptions masked and polling the status word is
>sufficient.
>
>>In my case, the code that may throw these exceptions is located in 3rd party 
>>defined plug-ins and not under my control, therefore I need to catch any 
>>runtime errors to avoid crashing the whole application if one module is 
>>buggy.
>
>That's not what C++ exceptions are for. In general, crashing the whole
>application is the desired result of a buggy plugin corrupting a program's
>state in unknown ways. Also, who's to say you won't interfere with a plugin
>that assumes FP exceptions are left in their default state, masked?
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
12/8/2007 3:56:59 AM
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:u65kl3lq7j2d7jifs8dce2e7p4dmc29pi6@4ax.com...
> What I did was use code of the form
> if(_isnan(fp))
>     throw new CFloatException(_T(__FILE__), __LINE__);
> where I derived
> class CFloatException : public CException {
>     public:
>         CFloatException(LPCTSTR file, int line) { ...stuff here...}
>     ...
> };
>
> I did this in an interpreter we built, so the points at which a NaN could 
> occur were
> well-defined.
>
> Some architectures like the Intel 960 would throw an FP exception only 
> after seven other
> FP instructions managed to push the result through the FP pipeline.  The 
> compiler for that
> architecture was a nightmare (a good friend of mine wrote the code 
> generator for the Ada
> compiler for that architecture...some of his code landed on Jupiter, and 
> some in Baghdad)
> joe
>

So this means FP exceptions in i960 were pretty much unrecoverable and 
nobody could know what's actually screwed up? No surprise Ariane rocket 
exploded because of FP error. 


0
alegr (1131)
12/8/2007 3:35:18 PM
No, they were deterministic, you knew EXACTLY that they occurred 7 instructions ago.  So
recovery involved doing a complicated backup of computation.  But given that floating
point failures are generally unrecoverable, the time didn't change the fact that the
program was screwed anyway.  This isn't like the IBM 360/91, where an FP exception could
happen at ANY time after a FP instruction, but you didn't know and couldn't find out which
FP instruction failed (the FPU was essentially an asynchronous pipeline, and when the
result finally emerged, in the case of multiply or divide, at some indeterminate time, you
could take an FP exception on an integer add, or a branch, or a call!)

The rocket exploded for a reason not related to FP exceptions; my recollection was that
there was just a fundamental algorithmic error, and having an exception happen, not
happen, or be recoverable, wasn't going to change the fact that the program was simply
wrong.
				joe

On Sat, 8 Dec 2007 07:35:18 -0800, "Alexander Grigoriev" <alegr@earthlink.net> wrote:

>
>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>news:u65kl3lq7j2d7jifs8dce2e7p4dmc29pi6@4ax.com...
>> What I did was use code of the form
>> if(_isnan(fp))
>>     throw new CFloatException(_T(__FILE__), __LINE__);
>> where I derived
>> class CFloatException : public CException {
>>     public:
>>         CFloatException(LPCTSTR file, int line) { ...stuff here...}
>>     ...
>> };
>>
>> I did this in an interpreter we built, so the points at which a NaN could 
>> occur were
>> well-defined.
>>
>> Some architectures like the Intel 960 would throw an FP exception only 
>> after seven other
>> FP instructions managed to push the result through the FP pipeline.  The 
>> compiler for that
>> architecture was a nightmare (a good friend of mine wrote the code 
>> generator for the Ada
>> compiler for that architecture...some of his code landed on Jupiter, and 
>> some in Baghdad)
>> joe
>>
>
>So this means FP exceptions in i960 were pretty much unrecoverable and 
>nobody could know what's actually screwed up? No surprise Ariane rocket 
>exploded because of FP error. 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
12/9/2007 4:17:02 AM
Thanks all for your replies.

While I haven't found a clean solution to my problem, I understand now that 
this is not an easy to handle issue, so I'll limit myself to the workaround 
I described.

a 


0
xxxxxxx (5)
12/9/2007 5:25:40 PM
On Sat, 08 Dec 2007 23:17:02 -0500, Joseph M. Newcomer
<newcomer@flounder.com> wrote:

>The rocket exploded for a reason not related to FP exceptions; my recollection was that
>there was just a fundamental algorithmic error, and having an exception happen, not
>happen, or be recoverable, wasn't going to change the fact that the program was simply
>wrong.

IIRC, they took some software developed for an earlier rocket, applied it
to a new rocket, but forgot to update the software to reflect the new
specification. I think it did cause an FP exception due to some flight
parameter going out of range, something that could not have happened with
the earlier rocket. The problem was, the code didn't deal with FP
exceptions and thus crashed. According to wiki, this is essentially
correct:

http://en.wikipedia.org/wiki/Ariane_5_Flight_501

I've always found this to be an interesting case, because it raises the
question of how to deal with program bugs that result in exceptions, a
problem lots of people apparently think they can somehow solve with C++
exceptions. This is an extreme case, to say the least, yet it doesn't seem
to clarify much. I mean, there was a wholly unexpected overflow due to a
bug. If you substitute the largest possible value and continue, that might
work, but then again, it might not. And even if substituting the largest
value were the best approximation to correctness for rockets, it seems
likely it would be a dang poor approximation to correctness for a medical
radiation delivery system. It always boils down to replacing failed
designed behavior with random undesigned behavior and hoping for the best.

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
12/9/2007 5:46:00 PM
Reply:

Similar Artilces:

Avoid plotting refferanced blanks as zeros in scatter plot graphs
I can not figure out how not to plot data that referances blank cells as zero's. I have a worksheet that links to tables with data orginized by size (mm) from big to small. This worksheet contains a scatter plot graph that looks at all sizes in the table. Typically not all sizes have data. The only way I can figure out to remove the zero values from the blank cells is by manualy selecting these cells and clearing the content. I have tried several attempts at differant logic ( if(isnumber(A1),A1,""), and if(isblank(A1),"",A1) ect. and nothing seems to work. ...

encoding problem in Outlook 2007 importing Outlook 2000 personal folders
I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese characters in the subject became unreadable but it's ok to display in message body. In Outlook 2000, there's no problem to display the Chinese characters in the subject. What's wrong with Outlook 2007? What setttings should I change to fix the problem? Thanks. cyl <u8526505@gmail.com> wrote: > I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese > characters in the subject became unreadable but it's ok to display in > message body. In Outlook 2000, there's no problem t...

Problem shortcuts in Word
Hello, I work with Word 2008. In the beginning there is no problem, but suddenly i have problem with shortcuts. When i want to do "cmd c" it make an other shortcuts same thing for "cmd s", "cmd v" and surly some other. But when i write there is no problem "c" is "c"... If somebody have an idea please help me. Thank you. Unless you indicate your specific update level of Office as well as OS X & describe what the keystrokes *are* doing contrary to what you expect there isn't much we can offer. -- Regards |:>)...

Outlook 2003 PST problems
I just installed Office 2003 professional on a new computer & am having problems with outlook. I copied my Outlook.pst file into the appropriate directory & although it is recognized the calendar is not working properly. I cannot attach any of the colored labels to my appointments - so everything is pretty much in black & white. I totally uninstalled & reinstalled office... first removing my pst file... but there appears to be an ini file... or something that is retaining some information... does anyone know of a fix for the labels... or how to TOTALLY uninstall office (so I...

Problem with Authentication
The CRM application was running smooth. But now I can't logging. It ask my credentials and than return a 401.1 error. I had already reinstalled the CRM server but it won't work. I'm accessing it in the same local network. I'm running CRM 3.0 in SBS. Best regards, Erico Hi When you open a Internet explorer and type the name of the CRM server, it prompts for user and password ? Are you logged in with domain credentials ( AD user ) ? If you are, so add url of the crm server in Local intranet. Enable "Automatic logon only in intranet", this is under security,c...

Vista blue screen problem...please help!
I've seen some other threads, here are the dump files: 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' (http://rapidshare.com/files/347103149/Minidump.rar.html) Please, help me out here. -- ceVil It might be better to know at what point the bsod occurs and what the actual err.msg given is "ceVil" <guest@unknown-email.com> wrote in message news:0b9a0c60b90bf6c0be88bda30f2820ab@nntp-gateway.com... > > I've seen some other threads, here are the dump files: > 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' > (...

calendar problem
Dear all, I am using both mail and calendar function in outlook 2002. Everything is ok until recently, when I try to make a new appointment or checking any old appointments, an error message "out of memory or resource, try to close some windows..." pop up. The mail function is still ok. Can anyone tell me how can I solve this? I have already installed sp2. The version of office is the professional one with frontpage. Thanks. tp ...

problem #4
Hi, I am facing this new problem... i.e a user has installed Office 2003 on win2k prof platform.. whenever she is working on a outlook.. she gets a Microsoft error message... saying to send the report or don't send the report... Usually I have seen this problem in IE... But for outlook it is new to me... after clicking on send or don't send report.. the outlook closes. And there are no IE open..... and if atall it is open.. the IE does not close... Need your help regards, KAH What is logged to the Event Viewer regarding this? Try one of the following already; http://www.howt...

95 and 97 problem
For some unknown reason there is Excel 95 and 97 on this pc.When i double click on an Excel file, the pc defaults to the 95 program (Which incidently doesn't work properly). So my question is how do i get the pc to default to 97. Cheers Craig Craig, Have a look at Windows Help. From Windows 2000 Help (Index under Programs Associating with File Types) To change which program starts when you open a file In My Computer or Windows Explorer, on the View menu, click Folder Options. Click the File Types tab. In the list of file types, click the one you want to change. Click Edit. In Act...

sync problems
I have all of my info on an HP Ipac. I had to reformat the hard drive and I did not make a back-up file. I am trying to move everything back to the computer but it says there is an error with syncing it. How can I move everything from the PDA back to Outlook again? Please help- thanks ...

Date problem
I can't believe there's no post on this, but I can't find it. I've tried the solutions I could find (see below) and still get the error: "The expression is typed incorrectly or it is too complex to be evaluated. For example....Try simplifying...." I have a date field, formatted as Date/Time, General Date, default Value = Now(). I like having the date and the time - in case we need it. I want to run a report on calls taken just for one day. I have CallDate: CallDateAndTime in my query, with "criteria" as Between ([Forms]![frmReports]![txtStartDate]) A...

Installation Problem!!
I am having a problem installing MSCRM 1.2. My configuration consists of a Domain Controller running Win 2000 Server SP4 . I am trying to install MSCRM on a member of the domain running Windows 2000 Server SP4. There is a DNS Server on the DC which is integrated with AD, and a SQL Server 2000 running on the Win 2K machine. The install errors out when CRM creates the root business with the message: Setup was unable to install Microsoft CRM Server. Setup was unable to provision your organization. Setup was unable to create the root business. The configuration of ASP.NET seems to be ok, the pr...

Office 2007 - HELP
I have used Word for many years and love it - not too thrilled with the changes in Office 2007, but my bigger issue is with Publisher 2007. I have an image that I have used in Word just fine - meaning, the on screen colors are correct and when printed the colors are correct. Someone sent me a Publisher file and asked me to add the image - I did this - now the image is messed up - the colors are correct on screen, but when printed FROM MY computer the image colors are all wrong - but if I transport the file to a different computer it prints fine I have reinstalled Office - no good Any id...

Resource editor problems
Hello all, Under VC++ 7.1... Please consider these two lines: IDC_ARROW_ADD_CANCEL DISCARDABLE "res\\cur00004.cur" IDC_ARROW_ADD_CANCEL CURSOR DISCARDABLE "res\\cur00004.cur" The second is a hand-edited change to the first. Both will compile just fine in the resource compiler. However, after I use a text editor to make this change, I cannot open the .rc file in the resource editor. The resource editor issues the following error open attempting to open the .rc file: error RC2135 : file not found: CURSOR Can anyone shed light on what's going on here? Thanks, Dave ...

Directory Replication Problem #2
Hi, recently my Exchange Server directory database receives changes from other servers but does not send out its own changes. Check from the knowledge base, to correct the USN discrepancy need to use Authrest.exe (need to amke changes for about 100+ users). Does anybody know where to get this file 'Authrest.exe' for exchange server 5.5? Exchange server 5.5 CD only provide this file for ver.4.0. Have anyone use it before? Regards, "Sharon Tan" <sharon_tansk@yahoo.com.sg> wrote: >Hi, recently my Exchange Server directory database >receives changes from ot...

Problems Creating a disclaimer in Exchange 2003
I am trying to create a server based disclaimer that will stamp all of my smtp emails going to the internet. I have been following KB article 317680 with no luck. I get an error like the one below. Binding Display Name Specified: smtpscriptinghost ** Registration Failed ** Err.Number (HRESULT) = 0x1AD Err.Description = ActiveX component can't create object ProgID = cdo.ss_smtponarrival COM Category = {FF3CAA23-00B9-11d2-9DFB-00C04FA322BA} Corresponding Event = onarrival ** Have you registered your sink COM class on this machine? I am puttin...

User Defined Variables in MS query cause a problem to import data
If I use user defined variables in MS query to import data into excel sheet, the query executes but no data gets imported into the excel sheet. If I get rid of the variable the results can be imported into the Excel sheet. ...

Cell Format
I have a spreadsheet with cells that I'm trying to type the date into. I type in the date exactly like this: 09/26/03. When I hit "enter" MS Excel displays "37890" in the cell. No matter what I do I can't the cell to show: 09/26/03. I think that somehow I need to "strip" the cell of what it's original format is, but I can't figure out how. I try to use the Date option in the format cell screen but it doesn't work. Curtis I tried this and it didn't work. I also tried the "Text to columns" feature. No success. >...

outlook web access redirect problem
hi, I have been trying to redirect outlook web access (OWA) from the IIS root folder to the /exchange folder. I have followed the instructions on going into the web site and redirecting to a folder but I just get the following URL when I browse to the root of my webserver : http://webmail/exchange/exchange - it's like it's doubling up somehow. I have it set to : A redirection to a URL redirect to: /exchange client will be sent to: A directory below URL entered I just can't work it out... any ideas... cheers Baronne Which instructions did you follow? I wrote the below articl...

Problem after sorting
In my Excel 2007 workbook I have two sheets The "Master Names" sheet has columns: (A) First|(B) Last (C) First (B) Last (concatenated) The "Selected Names" sheet contains (A) cells which link to selected (C) First Last (concatenated) cells in the Master Names sheet. Everything links and displays fine except when I add names to the bottom of the Master Names sheet and then sort using (B) Last name column. When I do this I get a 0 (zero) in the (A) First Second cells in the Selected names sheet and other cells in this sheet have the wrong name. Obviously I am doin...

IF AND problem
Need to isolate problems on 1600 rows Worksheet Row Dept Hrs. Dollars A5 120500 600 9000 A6 120600 400 8000 A7 130600 240 A8 130400 160 A9 140600 320 6400 A10 140200 100 2000 A11 140600 240 (Found out the dept has 2 leading blanks) Isolate problems on 0600 criteria pointing out when b has value and c = 0. OK if both are 0. A7 and A11 should stand out.. =IF((MID(A1,5,4)="0600")=AND(b1>=0=AND(c1>=0)),"NO","ok") Does this work for you: =IF(RIGHT(A...

Problem SHAppBarMessage
Hi, I am creating an application bar which shall be displayed always at the top of the screen to show the user certain alerts. I am using the commands SHAppBarMessage(ABM_NEW, &abd); SHAppBarMessage(ABM_QUERYPOS, &abd); SHAppBarMessage(ABM_SETPOS, &abd); SetWindowPos(NULL, abd.rc.left, abd.rc.top, abd.rc.right - abd.rc.left, iClientHeight, SWP_NOACTIVATE); Works fine. The problem begins, when I start moving the taskbar. I am catching the event OnSettingChange and my application bar is resizing/moving correctly. BUT: If the taskbar moves to the top and my application bar ...

Lookup() problem
I set up two lists, 200 employees names and 200 employee numbers. A couple of the numbers match the correct names but the rest of the numbers all pull the same employee name. =LOOKUP(C4,List!C4:C204,List!B4:B204) The first time I tried it seemed to pull the correct matching names and numbers then kabui it gets stuck. I tried deleting the entire lists cells and all and starting over but same thing. Anyone ever run into this before? Wayman Don't forget! When using Lookup(), the vector (second argument) must be sorted in ascending order. If it's not, you'll get what you ca...

Problem creating credit card account
When creating a Chase or Amazon.com credit cards I am having this happen to me when it creates the card and I can't figure out how to fix it so there is just one card showing. I attached a jpeg of what I am seeing. It's like it created multiple instances of the card and also show balances of my other cards. I am not sure if it is because these cards are associated with Chase or what. When I had it setup the online service for the card then that is when it creates the other instances. I hope someone can makes sence of this. Thanks! ...

Format an underline for zero in accounting format
I am preparing financial statements on Excel. The bottom number in a column is 0. It's underlined, but only from the left edge to the dash that represents the 0. I think I heard once about a custom format you could use to keep the dash, keep it lined up & have the underline go all the way across the cell. Does anyone know how? Thank you. You could use Conditional Formatting to do this. Assume you want this to apply from A2 to A20 - select those cells so tht A2 is the active cell and bring up the conditional formatting dialogue box. Choose Formula Is rather than Cell Val...