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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:20:24+00:00 2026-05-25T17:20:24+00:00

Hey guys im working on creating a new function in legacy visual C++ 6.0

  • 0

Hey guys im working on creating a new function in legacy visual C++ 6.0 dll project, so that a C# dll can call into, however i unable to do so due to name mangling and it seems no matter what I do I can’t stop it, (i used dumpbin to view the names) here is the relevant code

this is a really trimmed down verstion of the header file

#ifdef  _V7SSCOMM_CPP_
#define _DECL_V7COMM_DLL    __declspec(dllexport)
#else
#define _DECL_V7COMM_DLL    __declspec(dllimport)
#endif

#ifdef __cplusplus
extern "C" {
#endif
_DECL_V7COMM_DLL    DWORD V7ssGetFileDirInfoUnicode(LPCSTR szSign, V7_FILE_LIST_TYPE eListType, LPCSTR szServer, LPCSTR szLibrary, LPCSTR szExt, DWORD *pdwFileCnt, wchar_t *pbyFileBuf, DWORD *pdwFileBufSize);

#ifdef __cplusplus
}
#endif

#endif

and for the cpp file

_DECL_V7COMM_DLL    DWORD V7ssGetFileDirInfoUnicode(LPCSTR szSign, 
                                                         V7_FILE_LIST_TYPE eListType, 
                                                         LPCSTR szServer, LPCSTR szLibrary, LPCSTR szExt, 
                                                         DWORD *pdwFileCnt, wchar_t *pbyFileBuf, DWORD *pdwFileBufSize)
{
    if (!szSign || !szServer || !szLibrary || !szExt || !pdwFileCnt || !pbyFileBuf || !pdwFileBufSize)
        return (RPC_S_INVALID_ARG);

    error_status_t Error = rpcGetFileDirInfoUnicode(
        /* [in] */ g_hRpcBinding, 
        /* [in, string] */ (unsigned char *)szSign, 
        /* [in] */ (unsigned long)eListType, 
        /* [in, string] */ (unsigned char *)szServer,
        /* [in, string] */ (unsigned char *)szLibrary,
        /* [in, string] */ (unsigned char *)szExt,
        /* [out] */ (unsigned long *)pdwFileCnt, 
        /* [out, size_is(*pdwFileBufSize)] */ (wchar_t *)pbyFileBuf, 
        /* [in, out] */ (unsigned long *)pdwFileBufSize);

    return (Error);
} // end V7ssGetFileDirInfoUnicode()

dumpbin returns the following
1 0 00001401 ?V7ssGetFileDirInfoUnicode@@YAKPBDW4tag_V7_FILE_LIST_TYPE@@000PAKPAG2@Z

not what i wanted ideally it would only be V7ssGetFileDirInfoUnicode

As far as i can tell and from what i have been reading the way i trying to do this means i don’t need to define this in the .def file. What is odd, is im following the same extact setup as pre-existing functions that show up correctly.

I would be grateful for any help.Thanks!

Update

the .def file option works as far as not name mangling, that being said the MIDL compiler is not creating the RPC stub, I think these two issues are related.

also here is the MIDL version, taken from the C file iteself

/* this ALWAYS GENERATED file contains the RPC server stubs */


/* File created by MIDL compiler version 5.01.0164 */
/* at Wed Sep 21 08:57:22 2011
 */
/* Compiler settings for V7Rpc.idl:
    Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
    error checks: allocation ref bounds_check enum stub_data 
*/
//@@MIDL_FILE_HEADING(  )
  • 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-25T17:20:25+00:00Added an answer on May 25, 2026 at 5:20 pm

    If you are certain that you included the header file from the .cpp file, then you might try adding a .def file to your project. There might be other ways, but that has always seemed to be a critical part in reducing the name mangling in the exports. The contents would look something like this.

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

Sidebar

Related Questions

Hey guys I'm now working on a project that require upload a lot of
Hey guys, I'm working on a project. I need to use the function cvFindHomography
Hey guys, so I've got my NSFetchedResultsController working fine under the 3.1 SDK, however
Hey Guys...need help. Working on a project and get this error on the Output
Hey guys, I'm working on a cakephp app that manages a list of alpha
Hey guys i'm working on admin module for my project. When a person logs-in,
Hey guys, I'm working on a program for a university course that uses a
Hey guys, Im working with wpf 3d, im currently writing a program that will
Hey guys. I'm working in WinForms and trying to create a ComboBox control that
Hey guys I'm working on a chunk of my function and trying to keep

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.