Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

DLL

Werbeanzeige

Anonymous

unregistriert

1

01.07.2003, 13:30

DLL

Was muss ich tun, um mit VC6 eine DLL ohne Assistent und MFC zu erstellen?

2

01.07.2003, 17:40

Ganz einfach Datei->Neu->Dynamische Bibliothek->Leere DLL oder so ähnlich. Hab das nicht mehr so ganz im Kopf.
Wichtig! Ich übernehme keinerlei Verantwortung für eventl. Datenverlust oder Schäden am Rechner ;D

Anonymous

unregistriert

3

01.07.2003, 19:59

Was bedeuten dann die Parameter in

Quellcode

1
2
3
BOOL APIENTRY DllMain(HMODULE hModule, 
                      DWORD dwReasonForCall, 
                      LPVOID pvReserved)


?

Anonymous

unregistriert

4

01.07.2003, 20:13

hinstDLL
[in] Handle to the DLL module. The value is the base address of the DLL. The HINSTANCE of a DLL is the same as the HMODULE of the DLL, so hinstDLL can be used in calls to functions that require a module handle.
fdwReason
[in] Specifies a flag indicating why the DLL entry-point function is being called. This parameter can be one of the following values. Value Meaning
DLL_PROCESS_ATTACH Indicates that the DLL is being loaded into the virtual address space of the current process as a result of the process starting up or as a result of a call to LoadLibrary. DLLs can use this opportunity to initialize any instance data or to use the TlsAlloc function to allocate a thread local storage (TLS) index.
DLL_THREAD_ATTACH Indicates that the current process is creating a new thread. When this occurs, the system calls the entry-point function of all DLLs currently attached to the process. The call is made in the context of the new thread. DLLs can use this opportunity to initialize a TLS slot for the thread. A thread calling the DLL entry-point function with DLL_PROCESS_ATTACH does not call the DLL entry-point function with DLL_THREAD_ATTACH.
Note that a DLL's entry-point function is called with this value only by threads created after the DLL is loaded by the process. When a DLL is loaded using LoadLibrary, existing threads do not call the entry-point function of the newly loaded DLL.

DLL_THREAD_DETACH Indicates that a thread is exiting cleanly. If the DLL has stored a pointer to allocated memory in a TLS slot, it uses this opportunity to free the memory. The system calls the entry-point function of all currently loaded DLLs with this value. The call is made in the context of the exiting thread.
DLL_PROCESS_DETACH Indicates that the DLL is being unloaded from the virtual address space of the calling process as a result of unsuccessfully loading the DLL, termination of the process, or a call to FreeLibrary. The DLL can use this opportunity to call the TlsFree function to free any TLS indices allocated by using TlsAlloc and to free any thread local data.
Note that the thread that receives the DLL_PROCESS_DETACH notification is not necessarily the same thread that received the DLL_PROCESS_ATTACH notification.



lpvReserved
[in] Specifies further aspects of DLL initialization and cleanup.
If fdwReason is DLL_PROCESS_ATTACH, lpvReserved is NULL for dynamic loads and non-NULL for static loads.

If fdwReason is DLL_PROCESS_DETACH, lpvReserved is NULL if DllMain has been called by using FreeLibrary and non-NULL if DllMain has been called during process termination.

5

01.07.2003, 20:18

hModule ist der Handle zu deiner DLL.
dwReasonForCall kann einen der vier Parameter enthalten.
// Wird beim Eintritt übergeben
DLL_PROCESS_ATTACH
DLL_THREAD_ATTACH

// Wird beim Austritt übergeben
DLL_THREAD_DETACH
DLL_PROCESS_DETACH

Die DllMain Funktion ist sowohl die Eintritts als auch die Austrittsfunktion. Was die Parameter bedeuten ist in der Doku nachzu lesen. "DllMain" <- Suchbegriff in der Index Suche. Dort ist es ausführlich erklärt.

Der dritte weis ich jetzt auch net so genau. Er ist aber nicht immer NULL.
Wichtig! Ich übernehme keinerlei Verantwortung für eventl. Datenverlust oder Schäden am Rechner ;D

Anonymous

unregistriert

6

01.07.2003, 20:45

Danke,

aber warum erscheint beim kompilieren der DLL folgende Meldung:

[list]--------------------Konfiguration: DLL- Win32 Debug--------------------
Erstellen: Warnung: Erstellen fehlgeschlagen (oder nicht möglich) "...\Debug\DLL.pch"
Kompilierung läuft...
Datei.cpp
...Datei.cpp(58) : fatal error C1010: Unerwartetes Dateiende waehrend der Suche nach der Direktive fuer die vorkompilierte Header-Datei
Fehler beim Ausführen von cl.exe.

DLL.dll - 1 Fehler, 1 Warnung(en)[/list]

7

01.07.2003, 21:21

scheinbar will er die Vorkompilierte Header Datei haben. In den Settings die Vorkompilierten Header Files ausschalten.

Oder aber du hast irgendwo eine '}' oder ähnliches vergessen.
Wichtig! Ich übernehme keinerlei Verantwortung für eventl. Datenverlust oder Schäden am Rechner ;D

Anonymous

unregistriert

8

01.07.2003, 21:31

Nein, habe ich nicht ;)
Aber ich kann in den Einstellungen den genannten Eintrag nicht finden!

9

01.07.2003, 21:37

Such mal in den Eigenschaften des Projektes. Dort in C/C++ -> Vorkompilierte Header Dateien. Den genauen Ort kann ich dir net sagen. Hab mit VC 6 schon lange net mehr mit gearbeitet.
Wichtig! Ich übernehme keinerlei Verantwortung für eventl. Datenverlust oder Schäden am Rechner ;D

Anonymous

unregistriert

10

01.07.2003, 21:46

Danke, nur was sollen die Dateien:

[list]
- DLL.exp
- DLL.ilk
- DLL.lib
- VC60.idb
- VC6o.pdb[/list]

Werbeanzeige