Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DLL Class singelton export

Empfohlene Antworten

Veröffentlicht

Hallo Leutz, ich steh mal wieder auf der Leitung.

Ich habe eine DLL geschrieben. Ich möchte nur eine einzige Klasse exportieren, also nach außenhin sichtbar machen. Diese DLL binde ich in eine OCX ein. Leider bekomme ich immer einen Fehler. Siehe unten...

Was mache ich falsch und wie mache ich es richtig? Ich kann keinen Fehler finden. dieser Code war vorher in einer OCX eingebunden. Leider brauche ich aber jetzt eine DLL.

... header ...

#define DllExport __declspec( dllexport )

class DllExport CMyClass

{

public:

//Ein Zeiger auf die einzige Instance

static CMyClass* pInstance;

CMyClass(void);

CMyClass(const CMyClass&);

~CMyClass(void);

CMyClass& operator=(const CMyClass&);

//Singleton Instance erstellen

static CMyClass* getInstance()

{

if(!pInstance)

{

pInstance = NULL;

pInstance = new CMyClass;

}

return pInstance;

}

...

... cpp ...

/

/ Singleton Instance für das Objekt CMyClass

CMyClass* CMyClass::pInstance = NULL;

CMyClass::CMyClass(void)

{

...

...Fehlermeldung

MyClass error LNK2001: Nichtaufgelöstes externes Symbol "public: static class CMyClass* CMyClass::pInstance" (?pInstance@CMyClass@@2PAV1@A)'

Ich habe die DLL in eine Standard Anwendung eingebunden. Da tut es. Es schein Probleme mit der OCX zu geben. Aber warum?

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.