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.

Empfohlene Antworten

Veröffentlicht

Hi,

also ich versuche grad irgendwie Funktionen aus einer VB-Dll in C++ ausführen zu können.

Da man ja in VB beim erstellen einer Dll nichts als "export" deklarieren kann, möchte ich das ganze nun über COM machen.

Hab schon im I-Net mehrere Artikel gefunden, die sagen das das geht, aber noch kein Beispiel.

Weiss jemand wie das funktioniert und kann mir mal ein Beispiel geben?

Was willst Du denn jetzt tun ? Eine COM-Dll erstellen, oder Funktionen einer vorhandenen Dll in Deinem C-Code einbauen ?

Hi,

war etwas unverständlich oder? :)

Also ich habe eine Visual-Basic DLL.

Mein Problem ist der Zugriff von C++ aus.

Der geht meines Wissens nach nur über COM.

Die Frage stellt sich nur wie ich überhaupt ein COM object aus der VB-Dll bekomme.

#Import entfällt übrigends, ich brauche die DLL dynamisch.

Ich hoffe mein Problem war jetzt verständlicher.

??

Versteh ich jetzt nicht ! Aber wenn Du auf ne DLL zugreifen willst, warum dann nicht per LoadLibrary() und GetProcAddress() ?

Hi,

weil das bei einer Visual-Basic DLL nicht geht. Da bekommst du keine Adressen der Funktionen.

Hmmm...es gibt keine Adressen von VB-DLL's ?

Wie kann man diese dann einbinden ???

Also ich hab grad aus dem VB98-Ordner vom Visual Studio 2 VB-DLL's ins Systemverzeichnis kopiert und bekomme valide Werte von LoadLibrary und GetProcAddress.

??

Also wenn du mit VB ne normale DLL bildest bekommst du garantiert keine richtigen Adressen via GetProcAddress.

Das hab ich getestet.

Original geschrieben von Cool-Matthias

Also wenn du mit VB ne normale DLL bildest bekommst du garantiert keine richtigen Adressen via GetProcAddress.

Das hab ich getestet.

Was sagt denn Depends zu den DLLs? Und zeig uns doch mal den Code mit LL und GPA, mit den typedefs, falls Du welche machst.

Vielleicht ist es auch spezielle DLL, die kein DLLMain() hat. Dann braucht man aber ne Header oder ne .DEF oder Typbibliothek.

Auszug:

If the module is a DLL not already mapped for the calling process, the system calls the DLL's DllMain function with the DLL_PROCESS_ATTACH value. If the DLL's entry-point function does not return TRUE, LoadLibrary fails and returns NULL.

Das Problem besteht doch darin, dass liegt doch darin, dass man mit VB keine DLL schreiben kann, die eine normale Prozedur "exportiert".

Demnach sieht man mit Depends auch keine exportierten Funktionen und kann sie nicht per LoadLibrary() und GetProcAddress() laden.

Ich habe 2 Alternativen im Netz gefunden:

1. Alternative: ActiveX-DLL

http://www.codeproject.com/dll/vbactivexwithvc.asp

2. Alternative: wrapper-table (Hackerei)

http://www.al-williams.com/new/tips/tip30.htm

Außerdem gibt es noch ein paar Firmen, die diese Funktionalität als "Produkte" verkaufen:

z.B. http://simplysolutions.com/visdll/detail.html

Ich hoffe das hilft.

Endlich mal jemand der mich versteht !!!!!!!

Danke Olli! :)

Wenn mir jetzt noch jemand ob es eine dynamische Alternative zum "#import" der DLL gibt, bin ich zufrieden.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.