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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:14:56+00:00 2026-05-24T02:14:56+00:00

I am getting this error message: error C3861: ‘dim’: identifier not found Here are

  • 0

I am getting this error message:

error C3861: ‘dim’: identifier not found

Here are my includes:

#include "stdafx.h"
#include "HSMBTPrintX.h"
#include "HSMBTPrintXCtrl.h"
#include "HSMBTPrintXPropPage.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#endif

Here is my function:

#define MSS_PORTS_BASE _T("Software\\Microsoft\\Bluetooth\\Serial\\Ports")
bool FindBluetoothPort(TCHAR name[16]) {
    HKEY hKey, hRoot;
    TCHAR szPort[20] = _T(""), szPortString[20];
    DWORD len, dwIndex=0;
    bool bFound=false;
    INT i = 0, rc;
    DWORD dwNSize;
    DWORD dwCSize;
    TCHAR szClass[256];
    TCHAR szName[MAX_PATH];
    FILETIME ft;
    hRoot = HKEY_LOCAL_MACHINE;
    if (RegOpenKeyEx (hRoot, MSS_PORTS_BASE, 0, 0, &hKey) != ERROR_SUCCESS) {
        rc = GetLastError();
        return 0;
    }
    dwNSize = dim(szName);    <---- ~~ !! HERE IS THE LINE THAT ERRORS
    dwCSize = dim(szClass);     <---- HERE IS THE LINE THAT ERRORS  !! 
    rc = RegEnumKeyEx (hKey, i, szName, &dwNSize, NULL, szClass, &dwCSize, &ft);
    while (rc == ERROR_SUCCESS)
    {
        // how many children
        TCHAR szCurrentKey[MAX_PATH];
        wcscpy(szCurrentKey, MSS_PORTS_BASE);
        wcscat(szCurrentKey, TEXT("\\"));
        wcscat(szCurrentKey, szName);
        wcscat(szCurrentKey, TEXT("\\"));
        len = sizeof(szPort);
        if(RegGetValue(hRoot, szCurrentKey, _T("Port"), NULL, (LPBYTE)szPort, &len)) {
            wsprintf(szPortString, _T("%s:"), szPort);
            bFound = true;
            break;
        }
        dwNSize = dim(szName);
        rc = RegEnumKeyEx(hKey, ++i, szName, &dwNSize, NULL, NULL, 0, &ft);
    }

    if(bFound)
        _tcscpy(name, szPortString);

    return bFound;
}

As you can see, the two lines that use this are:

dwNSize = dim(szName);

dwCSize = dim(szClass);

Why is that an error?

  • 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-24T02:14:58+00:00Added an answer on May 24, 2026 at 2:14 am

    It looks like you are wanting sizeof:

    dwNSize = sizeof(szName);
    dwCSize = sizeof(szClass);
    

    sizeof returns the number of bytes of the object/variable. However, I just looked at the documentation for the API RegEnumKeyEx, and it needs the number of characters. So I think it actually should divide by the size of a TCHAR (which will be 1 or 2 depending on if your are building for Unicode).

    dwNSize = sizeof(szName) / sizeof(TCHAR);
    dwCSize = sizeof(szClass) / sizeof(TCHAR);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not sure why I am getting this error message. I have a
here i am getting this error message: Error 5 Ambiguity between 'OPTFDashboard.Common.Modules.CNAAll.ViewModels.CNAAllViewModel.Shift' and 'OPTFDashboard.Common.Modules.CNAAll.ViewModels.CNAAllViewModel.Shift'
i keep getting this error message: Object reference not set to an instance of
I'm getting this error message on all projects (including brand new empty templates) I'm
I'm getting this error message whiile running a Webservice I'm working on. it builds,
I'm getting this error message with the code below: class Money { public: Money(float
This error message is driving me nuts. I'm getting it when using Html.ListBox and
I'm getting this error message ... The Maximum string content length quota (8192) has
I'm getting this error: Compiler Error Message: CS0118: 'Configuration' is a 'namespace' but is
I'm getting this error message from git.What's this mean ? How to fix?

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.