AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) DLL Side-by-side registration & redirection
Thema durchsuchen
Ansicht
Themen-Optionen

DLL Side-by-side registration & redirection

Ein Thema von Der schöne Günther · begonnen am 21. Jun 2018 · letzter Beitrag vom 22. Jun 2018
 
EWeiss
(Gast)

n/a Beiträge
 
#10

AW: DLL Side-by-side registration & redirection

  Alt 22. Jun 2018, 01:46
Hier ein Beispiel in Sharp..
Von meinem BassVis Example in C# (Sharp)

Code:
private void BassInit()
{
  string BassPath;
  string BassVisPath;
  BASS_DEVICEINFO info;

  BassPath = Path.Combine(Application.StartupPath, "BassLib");
  Win32Api.SetEnvironmentVariable("Path", BassPath);

  // check the correct BASS was loaded
  if (Win32Api.HiWord(Bass.BASS_GetVersion()) != Bass.BASSVERSION)
  {
    MessageBox.Show("BASS_Vis.DLL existiert nicht!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
    Application.Exit();
  }

  //Set Path to AddOns
  BassVisPath = Path.Combine(Application.StartupPath, "BassADDOn");

  Win32Api.SetEnvironmentVariable("Path", BassVisPath);

  //Check "bass_Vis.dll" exist

  string visDll = Path.Combine(Application.StartupPath, @"BassADDOn\bass_Vis.dll");

  if (!File.Exists(visDll))
  {
    MessageBox.Show("BASS_Vis.DLL failed to load!", "BASS_Vis.DLL", MessageBoxButtons.OK, MessageBoxIcon.Error);
    Application.Exit();
  }

  // setup recording and output devices (using default devices)
  if ((Bass.BASS_RecordInit(-1) == false) || (Bass.BASS_Init(-1, 44100, 0, Handle, Guid.Empty) == false))
  {
    MessageBox.Show("Can\'t initialize device", "BASS.DLL", MessageBoxButtons.OK, MessageBoxIcon.Error);
    Application.Exit();
  }
  else
  {
    input_ = 0;
    info = new BASS_DEVICEINFO();
    while (Bass.BASS_RecordGetDeviceInfo(input_, info))
    {
      Bass.BASS_RecordGetDeviceInfo(input_, info);
      cmbInputs.Items.Add(info.name);
      input_++;
    }
    cmbInputs.SelectedIndex = 0;
  }

  Text = "Bass_Vis Example for C# VS2012: BassVis Version: " + BassVis.BASSVIS_GetVersion();
  Width = 498;
}

#endregion BassInit()
Ich setze die Umgebung nur für diese Anwendung nicht global von außen kann das also niemand sehen.
Die Anwendung startet ohne zu murren und die DLL's werden gefunden.

Und nein die DLL's werden nicht dynamisch geladen.
Ich glaube aber das Problem ist Delphi in dem Fall.
Zitat:
das tun wohl irgendwelche Delphi-Automatismen im Hintergrund.
gruss

Geändert von EWeiss (22. Jun 2018 um 02:20 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:23 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz