How to realize ## without #define (maybe with inline)?

Discussion in 'C++' started by Hua.watson@gmail.com, Sep 15, 2008.

  1. Guest

    #define ABC_DLL_F_GET(hDll, func_name) \
    { \
    (fproc_t &)lpfn##func_name = abc_GetProcAddress(hDll, #func_name); \
    }

    If I want to modity this #define macro to something in good C++ style
    like a inline func, how should I do?

    Thanks
    , Sep 15, 2008
    #1
    1. Advertising

  2. Guest

    by the way, this macro is used in an .cpp to provide explicit linking
    of DLL. It provides accessing to exported functions of DLL just like a
    normal function, as well as use the same header file provided by the
    DLL

    Is there any good library provides this functionality ? Then I need
    not write it myself
    , Sep 15, 2008
    #2
    1. Advertising

  3. Ian Collins Guest

    wrote:
    > by the way, this macro is used in an .cpp to provide explicit linking
    > of DLL. It provides accessing to exported functions of DLL just like a
    > normal function, as well as use the same header file provided by the
    > DLL
    >
    > Is there any good library provides this functionality ? Then I need
    > not write it myself
    >

    Maybe you should ask on a windows programming group where dlls are topical.

    --
    Ian Collins.
    Ian Collins, Sep 15, 2008
    #3
  4. red floyd Guest

    On Sep 14, 10:45pm, Ian Collins <> wrote:
    > wrote:
    > > by the way, this macro is used in an .cpp to provide explicit linking
    > > of DLL. It provides accessing to exported functions of DLL just like a
    > > normal function, as well as use the same header file provided by the
    > > DLL

    >
    > > Is there any good library provides this functionality ? Then I need
    > > not write it myself

    >
    > Maybe you should ask on a windows programming group where dlls are topical.


    I'm not so sure. I'm as much of an off-topic cop as the next guy, and
    it seems that what he's really looking for is how to replace the
    (ugly) macro with an inline function, which *is* on topic.
    red floyd, Sep 15, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lei Guangfu
    Replies:
    1
    Views:
    303
    Natty Gur
    Oct 19, 2003
  2. Ryan Ternier
    Replies:
    1
    Views:
    532
    John Saunders
    Jul 25, 2004
  3. Replies:
    0
    Views:
    517
  4. Guest
    Replies:
    5
    Views:
    602
  5. Ville Vainio
    Replies:
    11
    Views:
    589
    Hamish Lawson
    Aug 10, 2004
Loading...

Share This Page