Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8644197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:14:07+00:00 2026-06-12T12:14:07+00:00

So I have this DLL and I call it from my main application using

  • 0

So I have this DLL and I call it from my main application using AfxLoadLibrary. It all works fine letting me load it and call functions.

The strange bit is this.

If my application is launched from another application first using

::CreateProcess( File, CmdLine, 0, 0, FALSE, DETACHED_PROCESS, 0, 0, &StartupInfo, &ProcInfo )

then the launched application can’t load the dll anymore.

Little diagram so as not to confuse anyone.

MainApplication -> Dll (all Fine)

Launcher -> MainApplication -> DLL (AfxLoadLibrary fails with ERROR_NOACCESS)

Both the applications and the dll are in the same directory.

Edit:

Little more information I managed to get. It’s actually this bit of code in the dll that fails at ParseCommandLine.

 CCommandLineInfo cmdInfo;
 ParseCommandLine(cmdInfo);
 if (!ProcessShellCommand(cmdInfo))
    return FALSE;

Without this the dll doesn’t load up at all so can anyone say what’s changed once the launcher application gets involved.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:14:08+00:00Added an answer on June 12, 2026 at 12:14 pm

    Turns out the problem was with this line and not in the dll

    CreateProcess( File, CmdLine, 0, 0, FALSE, DETACHED_PROCESS, 0, 0, &StartupInfo, &ProcInfo )
    

    The CmdLine Variable could potentially have a space in it and wasn’t being wrapped in ” “.

    That caused the Command Line not being passed through properly in the chain breaking

    ParseCommandLine(cmdInfo);    
    

    and by chance worked on the launched exe.

    Edit:

    What this doesn’t solve though is if the exe with the dll is launched using CoCreateInstance the same problem in ParseCommandLine returns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have DLL and application that will call some function in this dll. For
I have a vc++ dll which has a funciton call like this : typedef
I have build a c# class library verification.dll using OpenCVSharp. This references OpenCvSharp.dll in
I have EXE and 2 DLL used by this EXE. All binary were compiled
I've got to call a routine from a supplied DLL. This DLL takes 2
I have an unmanaged (C/C++) DLL which I need to call from a C#
I want to call a C subroutine from Java. I'm using JNI. I have
I have a C# dll that I need to call from unmanaged C++. The
I have Windows Forms Application written on Delphi 7 and C++ .dll written using
I have this c# web app that relies heavily on two dll files that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.