---
name: "ACE_DLL_Strategy"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_DLL_Strategy"
---

# ACE\_DLL\_Strategy(3)

Defines the interface for specifying a creation strategy for a SVC\_HANDLER based on dynamic linking of the SVC\_HANDLER.

## NAME

ACE\_DLL\_Strategy -  Defines the interface for specifying a creation strategy for a SVC\_HANDLER based on dynamic linking of the SVC\_HANDLER.

## SYNOPSIS

```
#include <ace/ACE_Strategies_T.h>
template<class SVC_HANDLER>
class ACE_DLL_Strategy : public ACE_Creation_Strategy<SVC_HANDLER>
{
  public:
    ACE_DLL_Strategy (void);
    ACE_DLL_Strategy (
        const char dll_name[],
        const char factory_function[],
        const char svc_name[],
        ACE_Service_Repository *,
        ACE_Thread_Manager * = 0
        );
    int open (
        const char dll_name[],
        const char factory_function[],
        const char svc_name[],
        ACE_Service_Repository *,
        ACE_Thread_Manager * = 0
        );
    virtual int make_svc_handler (SVC_HANDLER *&);
    void dump (void) const;
    ACE_ALLOC_HOOK_DECLARE;
  protected:
    typedef ACE_Creation_Strategy<SVC_HANDLER> inherited;
    char dll_name_[MAXPATHLEN + 1];
    char factory_function_[MAXPATHLEN + 1];
    char svc_name_[MAXNAMELEN + 1];
    ACE_Service_Repository *svc_rep_;
};
```

## Intialization and termination methods.

```
ACE_DLL_Strategy (void);
```

"Do-nothing" constructor.

```
ACE_DLL_Strategy (
    const char dll_name[],
    const char factory_function[],
    const char svc_name[],
    ACE_Service_Repository *,
    ACE_Thread_Manager * = 0
    );
```

Initialize the DLL strategy based upon the service's DLL information contained in the svc\_dll\_info string.

```
int open (
    const char dll_name[],
    const char factory_function[],
    const char svc_name[],
    ACE_Service_Repository *,
    ACE_Thread_Manager * = 0
    );
```

Initialize the DLL strategy based upon the service's DLL information contained in the svc\_dll\_info string.

## Factory method.

```
virtual int make_svc_handler (SVC_HANDLER *&);
```

Create a SVC\_HANDLER by dynamically linking it from a DLL. Returns -1 on failure, else 0.

```
void dump (void) const;
```

Dump the state of an object.

```
ACE_ALLOC_HOOK_DECLARE;
```

Declare the dynamic allocation hooks.

## AUTHOR

Doug Schmidt

## LIBRARY

ace
