470,593 Members | 2,383 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,593 developers. It's quick & easy.

Can not create object of DirectorySearcher class with Visual C++ MFC with project reference of System.DirectoryServices.dll

3 Bit
System.DirectoryServices.dll file has been added successfully to Visual C++ project through References in Solution Explorer

Expand|Select|Wrap|Line Numbers
  1. using namespace System.DirectoryServices;//line 1268
  2. void CClassName::MethodName(){
  3. ...
  4.     DirectorySearcher* directorySearcher = new DirectorySearcher();//line 1701
  5.     directorySearcher->Timeout = 60000;//line 1702
  6. ...
  7. }
  8.  
  9. file.cpp(1268): error C2059: syntax error : '.'
  10. file.cpp(1701): error C2061: syntax error : identifier 'DirectorySearcher'
  11. file.cpp(1701): error C2065: 'directorySearcher' : undeclared identifier
  12. file.cpp(1701): error C2065: 'DirectorySearcher' : undeclared identifier
  13. file.cpp(1268): error C2143: syntax error : missing ';' before '.'
  14. file.cpp(1702): error C2228: left of '.Timeout' must have class/struct/union type
  15.         type is ''unknown-type''
  16. file.cpp(1268): error C2871: 'System' : a namespace with this name does not exist
  17. file.cpp(1702): error C3861: 'directorySearcher': identifier not found, even with argument-dependent lookup
  18.  
By this way I need to set Request Timeout for SOAP WebService
Apr 1 '22 #1
0 4528

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by MuZZY | last post: by
reply views Thread by Chris Frohlich | last post: by
1 post views Thread by =?Utf-8?B?SmVyZW15IENoYW5leQ==?= | last post: by
4 posts views Thread by Brandon McCombs | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.