Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with wsnprintf 1

Status
Not open for further replies.

darrellblackhawk

Programmer
Aug 30, 2002
846
US
I'm trying to compile an Active Directory example called:
"Example Code for Searching for Users" which is included with the Platform SDK.
I'm junior with C++ so I'm a little in the dark vis-a-vis
an error I get during compilation.

Code:
* The Error *
[tt]..\findusers.cpp(154) : error C2065: 'wsnprintf' : undeclared identifier[/tt]

* Code that causes it *
  // Add the filter.
  wsnprintf(pszSearchFilter, dwLength, L"(&(objectClass=user)(objectCategory=person)%s)",szFilter);

I'm assuming wsnprintf is a modification of printf, but I can only find scant reference to it ('wsnprintf') on the internet, include files, or sdk.

Am I forgetting to include some header, set a library reference, or have an incorrect compiler setting? (I assume so since I'm getting a *C2065 error*.)

I'm using Visual Studio 6.0

Any help would be appreciated.

Thanks
 
Try (right name of):
Code:
int _snwprintf( wchar_t *buffer, size_t count,
     const wchar_t *format [, argument] ... );
MS non-standard library extension func from <cstdio>...
 
Thanks!

I thought it might be something like that.

I'll try it out.

Darrell
 
Thanks. That solved it.
Now I have a cast problem, but I can figure that out.

Thanks again and a *Star*

Darrell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top