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. Advertisements

  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. Advertisements

  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. Advertisements

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. Abhi
    Replies:
    2
    Views:
    999
    E. Robert Tisdale
    Jul 3, 2003
  2. Guest
    Replies:
    5
    Views:
    857
  3. Alvin
    Replies:
    7
    Views:
    764
    E. Robert Tisdale
    May 6, 2005
  4. Replies:
    3
    Views:
    647
  5. Daniel Vallstrom
    Replies:
    2
    Views:
    2,938
    Kevin Bracey
    Nov 21, 2003
  6. Ville Vainio
    Replies:
    11
    Views:
    880
    Hamish Lawson
    Aug 10, 2004
  7. Nish
    Replies:
    4
    Views:
    788
    Thomas Stegen
    Oct 8, 2004
  8. TGOS
    Replies:
    3
    Views:
    591
    Kevin Bracey
    Feb 28, 2005
Loading...