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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:41:26+00:00 2026-05-23T04:41:26+00:00

note: First of all i am using visual studio 2010. Usually i need dll

  • 0

note: First of all i am using visual studio 2010.

Usually i need dll with some exported functions that i need to use from outside apps..

Normally this is how my dll header looks…

#define DLLAPI extern "C" __declspec(dllexport)

DLLAPI BOOL WINAPI FUNCTION1(...);
DLLAPI BOOL WINAPI FUNCTION2(...);

I don’t add any commands to the project or anything, all i do to export them is this in the headers + add DLLAPI to functions in the source file ofc.

Now when i need to get the function name from my outside app its making me problems because its always something like FUNCTION1xa1@assu79sax_ or something like that…

I saw a project which uses .DEF file and makes its headers like…

// INCLUDE FILE generated by "Pelles C for Windows, version 3.00".

#ifndef _HOOK_H
#define _HOOK_H

#ifdef _HOOK_
#define HOOKAPI  __declspec(dllexport)
#else
#define HOOKAPI  __declspec(dllimport)
#endif /* _HOOK_ */

#ifndef WINAPI
#define WINAPI  __stdcall
#endif

HOOKAPI int WINAPI SampleFunction(int, int);

#endif /* _HOOK_H */

and it’s .def file looks like…

EXPORTS
    SetValuesCBT
    SetValuesKey
    SetValuesMouse
    MouseProc
    KeyProc
    CBTProc

SECTIONS
    .shared READ WRITE SHARED

This results in very clear function names exported aka just as they are called(as proven by dumpbin.exe) btw if matters, it also has .pjj file with following content…

# 
# PROJECT FILE generated by "Pelles C for Windows, version 5.00".
# WARNING! DO NOT EDIT THIS FILE.
# 

POC_PROJECT_VERSION = 5.00.1#
POC_PROJECT_TYPE = 1#
POC_PROJECT_ARGUMENTS = #
CC = pocc.exe#
AS = #
RC = porc.exe#
LINK = polink.exe#
SIGN = posign.exe#
CCFLAGS = -Tx86-coff -Ot -W1 -Ze -Gz#
ASFLAGS = -c -nologo -coff -W1 -Cu#
RCFLAGS = -r#
LINKFLAGS = -machine:ix86 -subsystem:windows kernel32.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib advapi32.lib delayimp.lib -dll#
WizCreator = Pelle Orinius#
SIGNFLAGS = -location:CU -store:MY -timeurl:http://timestamp.verisign.com/scripts/timstamp.dll -errkill#
INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib#

.SILENT:

# 
# Build hook.dll.
# 
hook.dll: \
    output\DLL.obj \
    EXPORTS.DEF
    $(LINK) $(LINKFLAGS) -out:"$@" $**

# 
# Build DLL.obj.
# 
output\DLL.obj: \
    DLL.C
    $(CC) $(CCFLAGS) "$!" -Fo"$@"

.EXCLUDEDFILES:

I don’t know how should i emulate this in my VS 2010 project so when i build my dll function names are simple and precise?

  • 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-05-23T04:41:27+00:00Added an answer on May 23, 2026 at 4:41 am

    Just create the DEF file as you’ve shown above with just your two functions and go into the link options and specify to use this def file.

    From http://msdn.microsoft.com/en-us/library/34c30xs1%28v=vs.80%29.aspx

    The /DEF option passes a
    module-definition file (.def) to the
    linker. Only one .def file can be
    specified to LINK. For details about
    .def files, see Module-Definition
    Files. To set this linker option in
    the Visual Studio development
    environment

    1. Open the project’s Property Pages dialog box. For details, see
      Setting Visual C++ Project Properties.
    2. Click the Linker folder.
    3. Click the Input property page.
    4. Modify the Module Definition File property.

    To specify a .def file from within the
    development environment, you should
    add it to the project along with other
    files and then specify the file to the
    /DEF option.

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

Sidebar

Related Questions

First note: mathematically, I'm not that skilled at all. I played a game on
Setup: I am using MVC 3, EF 4.1, Visual Studio 2010 SP1 with Power
NOTE: I am not set on using VI, it is just the first thing
I have a VBPROJ (plus all source) which as created in Visual Studio 2005.
I'm writing an MPI program (Visual Studio 2k8 + MSMPI) that uses Boost::thread to
Note that these are my first steps in the world of C# so I
first of all, i am sorry that even if there's many given topic that
Note that I am not asking which to choose (MVC or MVP), but rather
Note The question below was asked in 2008 about some code from 2003. As
What I have installed... Windows Vista Ultimate Service Pack 1 Visual Studio 2008 Service

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.