[comp.windows.ms.programmer] My wonderful loadbitmap probelm

jdb@reef.cis.ufl.edu (Brian K. W. Hook) (03/26/91)

Just to keep you folks filled in, I changed my options from

All functions to exported
    to
Smart callbacks

Now it sort of works!  At least no more Exception 13 errors (at least at
that source line :-(

Would someone please explain to me what exactly the difference between
these two options are?  I know about exported functions, etc. but why
wouldn't ALL functions exported work instead of just smart callbacks?

Thanks,

Brian

sidney@borland.com (Sidney Markowitz) (03/26/91)

jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>Would someone please explain to me what exactly the difference between
>these two options are?  I know about exported functions, etc. but why
>wouldn't ALL functions exported work instead of just smart callbacks?

The option is not really all functions exported, it's all functions
exportable. A function will not be actually exported unless you either
use the _export keyword in its declaration, or enter the function name
in the EXPORTS section of the module definition file. So if smart
callbacks worked and all functions exportable did not, the difference
is likely to be that you missed exporting one or more functions in the
latter case. By the way, that seems to be the single most common
reason I have seen for BC++ Windows programs failing.

 -- sidney markowitz <sidney@borland.com>

jdb@reef.cis.ufl.edu (Brian K. W. Hook) (03/26/91)

In article <1991Mar26.034919.1670@borland.com> sidney@borland.com (Sidney Markowitz) writes:
|>jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
|>>Would someone please explain to me what exactly the difference between
|>>these two options are?  I know about exported functions, etc. but why
|>>wouldn't ALL functions exported work instead of just smart callbacks?
|>
|>The option is not really all functions exported, it's all functions
|>exportable. A function will not be actually exported unless you either
|>use the _export keyword in its declaration, or enter the function name
|>in the EXPORTS section of the module definition file. So if smart
|>callbacks worked and all functions exportable did not, the difference
|>is likely to be that you missed exporting one or more functions in the
|>latter case. By the way, that seems to be the single most common
|>reason I have seen for BC++ Windows programs failing.
|>
|> -- sidney markowitz <sidney@borland.com>

Obviously I am heavily confused here when and where a function needs to be
exported.  As far as I know, a function must be exported when Windows
itself will be calling a function from within Windows....example,
MainWndProc is called directly via function pointer by Windows.

NOOOOWWWWW....I would assume that since this is the case, MainWndProc MUST
be exported.  And since most of my simple programs have worked just fine up
until I added LoadBitmap(), why would it quit working by adding just
another function call in MainWndProc?  More specifically, how would
exporting MainWndProc (or whatever the hell I'm exporting with -WS!) affect
whether LoadBitmap() works or not?

Thanks,

Brian