Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Error loading C++.Net dll on networkdrv

Error loading C++.Net dll on networkdrv

Scheduled Pinned Locked Moved Managed C++/CLI
helpcsharpc++comsysadmin
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michaelschmitt
    wrote on last edited by
    #1

    Hi everybody, i'll try to explain my problem as short as possible: ->My C++ Dll (Native) should be able to call a C# DLL. Therefore i implemented a managed C++ dll as a bridge( to avoid COM). So, the C++(nat) calls the c++(.net) dll, which calls the c# dll. When the program is started on a local drive, everything works perfectly, but once it is copied to a network drive and run form there, loading the "bridge" - dll fails. In detail : The C++ 6.0 dll uses LoadLibrary to load the managed C++ dll and immedeately exits with Error 1114 " Dll initialization failed" - but ONLY started from a network drive. ( calling other dll's works ). I already tried to make a static link, same error... only on a network drive... I don't even have to call a function for getting the error.. I'm trying to find the mistake for a long time... but i think i'm at the end of my wisdom... Has anybody some kind of an idea, why calling my C++.Net dll only works on a local drive??? Problem with the dll- entry-point? Looking forward to some help! Thanks in advance! Michael

    J 1 Reply Last reply
    0
    • M michaelschmitt

      Hi everybody, i'll try to explain my problem as short as possible: ->My C++ Dll (Native) should be able to call a C# DLL. Therefore i implemented a managed C++ dll as a bridge( to avoid COM). So, the C++(nat) calls the c++(.net) dll, which calls the c# dll. When the program is started on a local drive, everything works perfectly, but once it is copied to a network drive and run form there, loading the "bridge" - dll fails. In detail : The C++ 6.0 dll uses LoadLibrary to load the managed C++ dll and immedeately exits with Error 1114 " Dll initialization failed" - but ONLY started from a network drive. ( calling other dll's works ). I already tried to make a static link, same error... only on a network drive... I don't even have to call a function for getting the error.. I'm trying to find the mistake for a long time... but i think i'm at the end of my wisdom... Has anybody some kind of an idea, why calling my C++.Net dll only works on a local drive??? Problem with the dll- entry-point? Looking forward to some help! Thanks in advance! Michael

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      It's because of security restrictions, no doubt.

      "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
      "You must be the change you wish to see in the world." - Mahatma Gandhi

      L 2 Replies Last reply
      0
      • J J Dunlap

        It's because of security restrictions, no doubt.

        "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
        "You must be the change you wish to see in the world." - Mahatma Gandhi

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Hi! But which restrictions? I do have w/r rights for that drv. In addition, my .exe has already successfully called 1 other dll (which is native c++ (fortunately :-) ) before calling the c++ managed dll. Meanwhile, I used the MS Dependeny walker. The profile results seem to show that there is a problem even when the program is started from a local drive ( by the way: which u don't notice without any tool, because it runs correctly ) Profile: ( static link this time ) caloader.exe = my exe cabridge = my c++ managed.dll Started "CALOADER.EXE" (process 0x6E8) at address 0x00400000. Loaded "NTDLL.DLL" at address 0x77F40000. . . . Loaded "CABRIDGE.DLL" at address 0x10000000. Loaded "MSCOREE.DLL" at address 0x79170000. DllMain(0x78000000, DLL_PROCESS_ATTACH, 0x00000000) in "RPCRT4.DLL" called. DllMain(0x78000000, DLL_PROCESS_ATTACH, 0x00000000) . . . Entrypoint reached. All implicit modules have been loaded. DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x0012FD30) in "CABRIDGE.DLL" called. Loaded "MSCORWKS.DLL" at address 0x791B0000. Loaded "MSVCR70.DLL" at address 0x7C000000. Loaded "FUSION.DLL" at address 0x79040000. . . . Loaded "MSCORLIB.DLL" at address 0x79780000. Loaded "MSCORLIB.DLL" at address 0x79960000. DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x0012FD30) in "CABRIDGE.DLL" returned 1 (0x1). DllMain(0x77E40000, DLL_THREAD_ATTACH, 0x00000000) in "KERNEL32.DLL" called. DllMain(0x77E40000, DLL_THREAD_ATTACH, 0x00000000) in "KERNEL32.DLL" returned 1 (0x1). DllMain(0x77DA0000, DLL_THREAD_ATTACH, 0x00000000) in "ADVAPI32.DLL" called. DllMain(0x77DA0000, DLL_THREAD_ATTACH, 0x00000000) in "ADVAPI32.DLL" returned 14679041 (0xDFFC01). DllMain(0x78000000, DLL_THREAD_ATTACH, 0x00000000) in "RPCRT4.DLL" called. . . First chance exception 0x80000003 (Breakpoint) occurred in "MSCOREE.DLL" at address 0x79172064. First chance exception 0xC0000005 (Access Violation) occurred in "CABRIDGE.DLL" at address 0x10000005. Second chance exception 0xC0000005 (Access Violation) occurred in "CABRIDGE.DLL" at address 0x10000005. Exited "CALOADER.EXE" (process 0x6E8) with code 128 (0x80). If you did read until here, thanks :-) here's my dll: #include "stdafx.h" #include "cabridge.h" #include "windows.h" extern "C" { #include } #using "mycsharp.dll" using namespace System; using namespace mycsharp; BOOL WINAPI DllMain (HMODULE hModule, DWORD x, LPVOID <) { return TRUE; } extern "C" { __declspec (dllex

        L 1 Reply Last reply
        0
        • L Lost User

          Hi! But which restrictions? I do have w/r rights for that drv. In addition, my .exe has already successfully called 1 other dll (which is native c++ (fortunately :-) ) before calling the c++ managed dll. Meanwhile, I used the MS Dependeny walker. The profile results seem to show that there is a problem even when the program is started from a local drive ( by the way: which u don't notice without any tool, because it runs correctly ) Profile: ( static link this time ) caloader.exe = my exe cabridge = my c++ managed.dll Started "CALOADER.EXE" (process 0x6E8) at address 0x00400000. Loaded "NTDLL.DLL" at address 0x77F40000. . . . Loaded "CABRIDGE.DLL" at address 0x10000000. Loaded "MSCOREE.DLL" at address 0x79170000. DllMain(0x78000000, DLL_PROCESS_ATTACH, 0x00000000) in "RPCRT4.DLL" called. DllMain(0x78000000, DLL_PROCESS_ATTACH, 0x00000000) . . . Entrypoint reached. All implicit modules have been loaded. DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x0012FD30) in "CABRIDGE.DLL" called. Loaded "MSCORWKS.DLL" at address 0x791B0000. Loaded "MSVCR70.DLL" at address 0x7C000000. Loaded "FUSION.DLL" at address 0x79040000. . . . Loaded "MSCORLIB.DLL" at address 0x79780000. Loaded "MSCORLIB.DLL" at address 0x79960000. DllMain(0x10000000, DLL_PROCESS_ATTACH, 0x0012FD30) in "CABRIDGE.DLL" returned 1 (0x1). DllMain(0x77E40000, DLL_THREAD_ATTACH, 0x00000000) in "KERNEL32.DLL" called. DllMain(0x77E40000, DLL_THREAD_ATTACH, 0x00000000) in "KERNEL32.DLL" returned 1 (0x1). DllMain(0x77DA0000, DLL_THREAD_ATTACH, 0x00000000) in "ADVAPI32.DLL" called. DllMain(0x77DA0000, DLL_THREAD_ATTACH, 0x00000000) in "ADVAPI32.DLL" returned 14679041 (0xDFFC01). DllMain(0x78000000, DLL_THREAD_ATTACH, 0x00000000) in "RPCRT4.DLL" called. . . First chance exception 0x80000003 (Breakpoint) occurred in "MSCOREE.DLL" at address 0x79172064. First chance exception 0xC0000005 (Access Violation) occurred in "CABRIDGE.DLL" at address 0x10000005. Second chance exception 0xC0000005 (Access Violation) occurred in "CABRIDGE.DLL" at address 0x10000005. Exited "CALOADER.EXE" (process 0x6E8) with code 128 (0x80). If you did read until here, thanks :-) here's my dll: #include "stdafx.h" #include "cabridge.h" #include "windows.h" extern "C" { #include } #using "mycsharp.dll" using namespace System; using namespace mycsharp; BOOL WINAPI DllMain (HMODULE hModule, DWORD x, LPVOID <) { return TRUE; } extern "C" { __declspec (dllex

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          sorry, please ignore extern "C" { #include } was a copy / paste err thanks for your help!

          1 Reply Last reply
          0
          • J J Dunlap

            It's because of security restrictions, no doubt.

            "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
            "You must be the change you wish to see in the world." - Mahatma Gandhi

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Hi, consider this thread as "solved" . Meanwhile, someone has given me a hint : The problems i seem to have are described in the MSDN tecnical articles, topic "Mixed DLL Loading Problem". It further seems to be some kind of runtime-problem and can be avoided somehow.. perhaps.. I'll try it out

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups