Board index » cppbuilder » W8066 Unreachable code

W8066 Unreachable code


2005-03-20 07:25:14 PM
cppbuilder48
Hi,
I have a problem with using some API functions for Outlook Express.
here is short example:
Unit1.cpp is at: www.uncledelacruz.net/down/Unit1.cpp
Unit1.h is at: www.uncledelacruz.net/down/Unit1.h
and msoeapi.h is at: www.uncledelacruz.net/down/msoeapi.h
Problem is that I got warning: W8066 Unreachable code
on this line:
props.cbSize = sizeof(FOLDERPROPS);
Whats the problem please?
Please help.
standus
 
 

Re:W8066 Unreachable code

Hi,
I have a problem with using some API functions for Outlook Express.
here is short example:
Unit1.cpp is at: www.uncledelacruz.net/down/Unit1.cpp
Unit1.h is at: www.uncledelacruz.net/down/Unit1.h
and msoeapi.h is at: www.uncledelacruz.net/down/msoeapi.h
Problem is that I got warning: W8066 Unreachable code
on this line:
props.cbSize = sizeof(FOLDERPROPS);
Whats the problem please?
Please help.
standus
 

Re:W8066 Unreachable code

On 20 Mar 2005 03:33:40 -0800, "standus" < XXXX@XXXXX.COM >wrote:
Quote

Hi,

I have a problem with using some API functions for Outlook Express.

here is short example:
Unit1.cpp is at: www.uncledelacruz.net/down/Unit1.cpp
Unit1.h is at: www.uncledelacruz.net/down/Unit1.h
and msoeapi.h is at: www.uncledelacruz.net/down/msoeapi.h

Problem is that I got warning: W8066 Unreachable code
on this line:
props.cbSize = sizeof(FOLDERPROPS);

Whats the problem please?
Hi Standus,
the 'if' just preceding the offending line misses a closing brace (}).
Thus, this line is considered to be part of the 'if' AND it follows a
'return', so it can never be reached.
Normally, this code shouldn't even compile because of the missing '}',
but you have a second error: The next to last line of this function
contains a superfluous '}', so that for the compiler all braces match.
Nice way to shoot yourself in the foot :)
HTH
Helmut Giese
 

{smallsort}

Re:W8066 Unreachable code

Yes It was the problem.
But in finaly it dos not work.
So I rebuild it from begining and now its looking good except this error:
[C++ Error] Unit1.cpp(70): E2451 Undefined symbol 'm_pStoreNamespace'
All rebuilded files are in the same web location.
I am using this source:
www.codeproject.com/com/Outlook_Express_Messages.asp
Thank for your help.
Standus
"Helmut Giese" < XXXX@XXXXX.COM >píše v diskusním příspěvku
Quote
On 20 Mar 2005 03:33:40 -0800, "standus" < XXXX@XXXXX.COM >wrote:

>
>Hi,
>
>I have a problem with using some API functions for Outlook Express.
>
>here is short example:
>Unit1.cpp is at: www.uncledelacruz.net/down/Unit1.cpp
>Unit1.h is at: www.uncledelacruz.net/down/Unit1.h
>and msoeapi.h is at: www.uncledelacruz.net/down/msoeapi.h
>
>Problem is that I got warning: W8066 Unreachable code
>on this line:
>props.cbSize = sizeof(FOLDERPROPS);
>
>Whats the problem please?
Hi Standus,
the 'if' just preceding the offending line misses a closing brace (}).
Thus, this line is considered to be part of the 'if' AND it follows a
'return', so it can never be reached.
Normally, this code shouldn't even compile because of the missing '}',
but you have a second error: The next to last line of this function
contains a superfluous '}', so that for the compiler all braces match.
Nice way to shoot yourself in the foot :)
HTH
Helmut Giese
 

Re:W8066 Unreachable code

On Sun, 20 Mar 2005 20:48:22 +0100, "Standus" < XXXX@XXXXX.COM >wrote:
Quote
Yes It was the problem.

But in finaly it dos not work.
So I rebuild it from begining and now its looking good except this error:
[C++ Error] Unit1.cpp(70): E2451 Undefined symbol 'm_pStoreNamespace'
Well, this can only mean that it is unknown to the compiler
- either because you forgot to #include a required header file or
- because of a typo
Search in all your .h files for 'm_pStoreNamespace' (would be the
definition of a struct or a class) and then #include this file.
HTH
Helmut Giese
 

Re:W8066 Unreachable code

Standus wrote:
Quote
But in finaly it dos not work.
So I rebuild it from begining and now its looking good except this error:
[C++ Error] Unit1.cpp(70): E2451 Undefined symbol 'm_pStoreNamespace'
You forgot the class name in the definition of AddFolders(). You will
also have to remove the default value from the definition:
void TForm1::AddFolders(STOREFOLDERID dwFolderId)
Ivan Johansen
 

Re:W8066 Unreachable code

Yes .... its working well.
Thank you very much Ivan.
Stan
"Ivan Johansen" < XXXX@XXXXX.COM >píse v diskusním príspevku
Quote
Standus wrote:
>But in finaly it dos not work.
>So I rebuild it from begining and now its looking good except this error:
>[C++ Error] Unit1.cpp(70): E2451 Undefined symbol 'm_pStoreNamespace'

You forgot the class name in the definition of AddFolders(). You will also
have to remove the default value from the definition:
void TForm1::AddFolders(STOREFOLDERID dwFolderId)


Ivan Johansen