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 8134189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:55:34+00:00 2026-06-06T09:55:34+00:00

There are three files lay at с:/catalog. They are lib.dll, conf.ini,libImp.cpp. And I call

  • 0

There are three files lay at с:/catalog. They are lib.dll, conf.ini,libImp.cpp.
And I call lib.dll “init” function in libImp.cpp file. For success call of “init” function it is necessarily to have conf.ini laying in the same directory.
The issue is if I try to call the dll function from another directory, the error appears. It says that it doesn`t see conf.ini. For example, if libImp.cpp located at the c:/catalog2, then that error appears.
The part of code, which responds for call dll function:

HINSTANCE hGetProcIDDLL = LoadLibrary("c:\\catalog\\lib.dll");
FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),"init");
typedef int (__stdcall * pICFUNC)(char *);

pICFUNC init;
init = pICFUNC(lpfnGetProcessID);

bool result = 0;
char user_id[]="user";
result = init(user_id);

How to make function call independently of the cpp file location?

  • 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-06T09:55:36+00:00Added an answer on June 6, 2026 at 9:55 am

    You’re mixing concepts.

    .cpp files are used as input for the compiler, and cannot be executed themselves. It doesn’t matter whether the input file libImp.cpp is located in c:\catalog\. It might matter where the compiler output (an .EXE I assume?) ends up.

    The location of the .INI file is determined by the code in the DLL. It’s loading the INI file, so it determines where to look for the INI file. We cannot guess where it’s looking. A tool like SysInternals ProcMon can be used to monitor the DLL and check where it’s looking.

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

Sidebar

Related Questions

I have three files: lib.c lib.h => They should be built as a .so
I have a system where employees can upload files. There are three ways Upload
I have three files: movie.h (header); movie.cpp (implementation file); lab9.cpp (driver file using movie
I have three files, a main .cpp file: #include <stdio.h> #include myClass.h int main()
I have the following three files in the same directory: citysim.cpp #include utils.h using
There are three files: source1.c source2.c header.h The two source-files includes the header. This
there are three files: common.php, controller.php and user.php. File common.php looks like: <?php define(MAXIMUM_NAME_LENGTH,
I downloaded the yelp github for python and there's three files inside the python
I have a code in which I #include<linux/videodev2.h> . There are three files: one
I have three files . The contents of main.cpp are #include<iostream> #include<QString> #include util.h

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.