Click here to Skip to main content
15,921,548 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: The free useful tool does not work on Windows 10. Pin
David Crow28-Feb-21 15:22
David Crow28-Feb-21 15:22 
GeneralRe: The free useful tool does not work on Windows 10. Pin
mbncvbut5-Mar-21 19:43
mbncvbut5-Mar-21 19:43 
QuestionC(17) Complete Tutorial References Pin
chipp_zanuff23-Feb-21 6:35
chipp_zanuff23-Feb-21 6:35 
AnswerRe: C(17) Complete Tutorial References Pin
CPallini23-Feb-21 20:27
mveCPallini23-Feb-21 20:27 
GeneralRe: C(17) Complete Tutorial References Pin
chipp_zanuff25-Feb-21 6:45
chipp_zanuff25-Feb-21 6:45 
GeneralRe: C(17) Complete Tutorial References Pin
CPallini25-Feb-21 20:07
mveCPallini25-Feb-21 20:07 
GeneralRe: C(17) Complete Tutorial References Pin
chipp_zanuff26-Feb-21 5:59
chipp_zanuff26-Feb-21 5:59 
AnswerRe: C(17) Complete Tutorial References Pin
Richard MacCutchan23-Feb-21 21:58
mveRichard MacCutchan23-Feb-21 21:58 
GeneralRe: C(17) Complete Tutorial References Pin
chipp_zanuff25-Feb-21 6:43
chipp_zanuff25-Feb-21 6:43 
GeneralRe: C(17) Complete Tutorial References Pin
Victor Nijegorodov25-Feb-21 7:47
Victor Nijegorodov25-Feb-21 7:47 
GeneralRe: C(17) Complete Tutorial References Pin
Richard MacCutchan25-Feb-21 23:12
mveRichard MacCutchan25-Feb-21 23:12 
GeneralRe: C(17) Complete Tutorial References Pin
chipp_zanuff26-Feb-21 6:36
chipp_zanuff26-Feb-21 6:36 
GeneralRe: C(17) Complete Tutorial References Pin
Richard MacCutchan26-Feb-21 6:43
mveRichard MacCutchan26-Feb-21 6:43 
AnswerRe: C(17) Complete Tutorial References Pin
Aghast (nj)9-Mar-21 19:27
Aghast (nj)9-Mar-21 19:27 
GeneralRe: C(17) Complete Tutorial References Pin
Nelek9-Mar-21 19:29
protectorNelek9-Mar-21 19:29 
GeneralRe: C(17) Complete Tutorial References Pin
chipp_zanuff13-Mar-21 0:54
chipp_zanuff13-Mar-21 0:54 
QuestionGetComputerObjectNameW Win API is failing Pin
rajneshmalik18-Feb-21 18:42
rajneshmalik18-Feb-21 18:42 
I was trying to use win API
GetComputerObjectNameW
as below but I am getting error. Can someone help me.

C++
#include <iostream>
#include <atlbase.h>
#include <secext.h>
typedef enum  {
  NameUnknown,
  NameFullyQualifiedDN,
  NameSamCompatible,
  NameDisplay,
  NameUniqueId,
  NameCanonical,
  NameUserPrincipal,
  NameCanonicalEx,
  NameServicePrincipal,
  NameDnsDomain,
  NameGivenName,
  NameSurname
} EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT;

int main()
{
        EXTENDED_NAME_FORMAT enf = NameFullyQualifiedDN;
        LPWSTR pwszComputerName;
        DWORD dwLen;
        
        dwLen = 0;
        GetComputerObjectNameW(enf, NULL, &dwLen);
    
        pwszComputerName = new WCHAR[dwLen + 1];
        if(NULL == pwszComputerName)
        {
            return 0;
        }
        if(!GetComputerObjectNameW(NameSamCompatible, pwszComputerName, &dwLen))
        {
            delete pwszComputerName;
            return 0;
        }

        sbstrTrustee = pwszComputerName;
        wprintf(L"GetComputerObjectName: %s\n", pwszComputerName);
        delete pwszComputerName;
}


Some of Error message is as below.

C:\Program Files (x86)\Windows Kits\8.1\include\\shared\secext.h(117): error C2146: syntax error: missing ';' before identifier 'GetUserNameExA'
C:\Program Files (x86)\Windows Kits\8.1\include\\shared\secext.h(121): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Windows Kits\8.1\include\\shared\secext.h(126): error C2086: 'BOOLEAN SEC_ENTRY': redefinition
C:\Program Files (x86)\Windows Kits\8.1\include\\shared\secext.h(117): note: see declaration of 'SEC_ENTRY'
C:\Program Files (x86)\Windows Kits\8.1\include\\shared\secext.h(126): error C2146: syntax error: missing ';' before identifier 'GetUserNameExW'
C:\Program Files (x86)\Windows Kits\8.1\include\\shared\secext.h(130): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

AnswerRe: GetComputerObjectNameW Win API is failing Pin
Victor Nijegorodov18-Feb-21 20:46
Victor Nijegorodov18-Feb-21 20:46 
GeneralRe: GetComputerObjectNameW Win API is failing Pin
rajneshmalik18-Feb-21 21:47
rajneshmalik18-Feb-21 21:47 
GeneralRe: GetComputerObjectNameW Win API is failing Pin
Victor Nijegorodov18-Feb-21 22:45
Victor Nijegorodov18-Feb-21 22:45 
GeneralRe: GetComputerObjectNameW Win API is failing Pin
rajneshmalik19-Feb-21 1:01
rajneshmalik19-Feb-21 1:01 
GeneralRe: GetComputerObjectNameW Win API is failing Pin
Victor Nijegorodov19-Feb-21 3:33
Victor Nijegorodov19-Feb-21 3:33 
GeneralRe: GetComputerObjectNameW Win API is failing Pin
rajneshmalik25-Mar-21 23:27
rajneshmalik25-Mar-21 23:27 
AnswerRe: GetComputerObjectNameW Win API is failing Pin
Randor 18-Feb-21 22:43
professional Randor 18-Feb-21 22:43 
QuestionUnexpected output in array Pin
Member 1507028617-Feb-21 18:43
Member 1507028617-Feb-21 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.