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

  • Home
  • SEARCH
  • 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 8008047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:01:07+00:00 2026-06-04T18:01:07+00:00

I have a simple DLL that I am trying to compile in VS2010 Express.

  • 0

I have a simple DLL that I am trying to compile in VS2010 Express.
The code for the DLL is as follows:

#pragma comment(linker, "/EXPORT:PlusOne=_PlusOne@4")

#include <windows.h>
#include <commctrl.h>

extern "C"  __declspec(dllexport) int PlusOne(int inNum)
{
    inNum++;
    return inNum;
};

extern "C"  __declspec(dllexport) LRESULT CALLBACK OwnerDrawButtonProc(HWND hWnd, UINT uMsg, WPARAM wParam,
                               LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
{
//further processing will go here
   return DefSubclassProc(hWnd, uMsg, wParam, lParam);
};

__stdcall is selected in the project options

The plusOne function on its own compiles fine but the second function does not.

DefSubclassProc is declared in commctrl.h but I get an error on the function, full error text including the libraries searched (which includes commdlg32 where this function lives) is below:

1>  Searching libraries
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winmm.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\kernel32.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\user32.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\gdi32.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\winspool.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\comdlg32.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\advapi32.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\shell32.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\ole32.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\oleaut32.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\uuid.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\odbc32.lib:
1>      Searching C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\odbccp32.lib:
1>      Searching c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\MSVCRT.lib:
1>      Searching c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\OLDNAMES.lib:
1>  
1>  Finished searching libraries
1>dlltest.obj : error LNK2001: unresolved external symbol _DefSubclassProc@16
1>s:\documents\my documents\visual studio 2010\Projects\dlltest\Release\dlltest.dll : fatal error     LNK1120: 1 unresolved externals

It looks like it can’t find the function but the library and header are present so I don’t understand why.

As a small aside the motivation for the code is that I am subclassing a window in vba, but having the windowprocedure in vba is very unstable so I want to try and move it into a dll.

Please help me understand what is going wrong here.

  • 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-04T18:01:08+00:00Added an answer on June 4, 2026 at 6:01 pm

    “Comctl32.lib” (not “commdlg32.lib”) is where this function “lives”.

    See MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/bb776403(v=vs.85).aspx

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

Sidebar

Related Questions

I have a very simple DLL written in unmanaged C++ that I access from
I have a simple application that loads an unmanaged dll and passes a few
I'm trying to compile a simple DLL on a Mac OS X 10.6, and
I'm trying to split some prior crafted code into a DLL. It's a simple
I have simple php validation form that is halfway working. If you leave the
I have simple win service, that executes few tasks periodically. How should I pass
I have started initially with VC++ 2008 Express. I've noticed that GCC becomes kind
I have a C# application (project A) that requires X.dll. I have added the
Note: All sample code is greatly simplified. I have a DLL defined as: using
I have been trying to add a .cu file into my own(dll) win32 project

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.