Menu

Exporting a class from a dll

deostroll
2009-06-01
2012-09-26
  • deostroll

    deostroll - 2009-06-01

    Hi,

    I am trying to export a class from a dll. I would want to be able to use my class from my main program as a normal class.

    The thing I don't understand is, how will my main program be able to use the class when the entire class is declared in the dll...?!

    What is that additional thing required in my main program?

    --deostroll

    Ps: I'm not an advanced c/c++ user

     
    • cpns

      cpns - 2009-06-02

      > Okay if that is impossible

      That is not what I said. If you don't have the original header file, create it. That said, if the DLL was written using a different compiler, that won't work either, because different compilers use different schemes for name-mangling.

      Why don't you have what you need to use this DLL? It begs the question of whether you should be using it at all. I wouldn't bet my business on unsupported black-box code

      Clifford

       
    • cpns

      cpns - 2009-06-02

      > What is that additional thing required in my main program?

      ... a header file with the class declaration. The declaration must match that used to build the DLL code. This is usually done by using the same header file.

      Clifford

       
      • deostroll

        deostroll - 2009-06-02

        Okay if that is impossible then I guess COM is the only alternative. Or is it? I am looking for a brief explanation as to how we would make use of COM in the main program. Thanx in advance.

        --deostroll

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.