CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 1999
    Location
    Austria, Vienna
    Posts
    2

    Runtime decision



    hi,


    is it possible to decide while runtime wich package to use?

    For example, i wrote different socket-classes for OS/2 and NT and

    during runtime i have to decide wich classes for the specific

    operating system i have to use.


    Thanks in advance


    werner hutmacher (from germany)



  2. #2
    Join Date
    May 1999
    Posts
    93

    Re: Runtime decision



    Use the complete name for the class you need. E.g.



    boolean isNT = myFunctionToDetermineNT();


    Socket s;

    if( isNT )

    {

    s = new mypackage.nt.Socket();

    }

    else

    {

    s = new mypackage.os2.Socket();

    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured