Important: Please read the Qt Code of Conduct -

How to assign a static function to a funtion pointer in C++

  • Hi all,

    I use gsoap library in the application.
    My application is developed in C++ and it works fine with gsoap C++ library.

    Now i built the same stdsoap2.c as a gsoap C library.

    I assign static functions( which are not a part of my class) to
    soap->frecv and soap->fsend.
    And i observed that in stdsoap2.c the pointers are reversed.

    frecv in SoapJob::run == 0x807a448 //When assigned
    fsend in SoapJob::run== 0x807a4e8

    soap->frecv in gsoapC lib == 0x807a4e8 // On invokation.

    So, instead of invoking frecv, fsend is invoked.
    But when i test with gsoap C++ library,pointers are intact.

    It will be of great help if you can let me know how to fix this issue.

  • Hi.

    I am not experienced with gsoap, but I would like to learn something with this.

    Can you provide a simple example ?

    so I wil be able to reproduce your problem ?

    It looks interesting

    best regards.

Log in to reply