Today i think that maybe the SchemaIDGUID can only accept Base64, so i replaced the {BCE8B3C4-9A94-4C34-8E76-AA4A682CBA2C} with Base64 xLPovJSaNEyOdqpKaCy6LA== , but the program still failed:(
Maybe Rick Kingslan is right, i can't assign a GUID to an object when i create the object, then what about modifying the Value of SchemaIDGUID after i create the object? i will test it after i send this mail:) 
      
----- Original Message -----
Sent: Wednesday, May 28, 2003 8:46 PM
Subject: RE: [ActiveDir] how can i add the value of the SchemIDGUID when I create a schemd object?

I am FAR from the expert on this subject, but I do know a thing or two.  (Gil, where are you when we need you???  ;-)  )
 
The one thing that I see is that you're trying to force a GUID.  I don't think that you can do this.  You can't assign a GUID to an object - it's assigned when created.  You're assigning an OID, which is good - as long as it is unique and created via, say OIDGEN. 
 
Everything else looks fine.  This probably explains why the program runs without the statement in question, but won't when you have it in.  It's not supposed to be there.
 
Anyone else know schema manipulation with C++?  ;-)
 

Rick Kingslan  MCSE, MCSA, MCT
Microsoft MVP - Active Directory
Associate Expert
Expert Zone - www.microsoft.com/windowsxp/expertzone
 




From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of zhaohu
Sent: Wednesday, May 28, 2003 2:29 AM
To: [EMAIL PROTECTED]

this is some code in my program, i create the schema object it:
 
----------------------------------------------------------------
hr = piSchema->Create( L"classSchema", L"CN=TestClass", &piDisp );
   .
   .
   .    
    hr = piDisp->QueryInterface( IID_IADs, ( void** )&piIADsClass );
    if( SUCCEEDED( hr ) )
    {
     hr = piIADsClass->Put( L"objectClass", _variant_t( L"classSchema" ) );
     hr = piIADsClass->Put( L"lDAPDisplayName", _variant_t( L"TestClass" ) );
     hr = piIADsClass->Put( L"governsID", _variant_t( L"1.3.6.1.4.1.1593.4.2.1.1.2.43" ) );
     hr = piIADsClass->Put( L"subClassOf", _variant_t( L"top" ) );
     hr = piIADsClass->Put( L"possSuperiors",_variant_t( L"organizationalUnit") );
     hr = piIADsClass->Put( L"schemaIDGUID",_variant_t(L"{BCE8B3C4-9A94-4C34-8E76-AA4A682CBA2C}"));
     hr = piIADsClass->PutEx(ADS_PROPERTY_APPEND, L"mayContain", varNames3);
     
     
.
     .
     .
----------------------------------------------------------------------
 
but it failed when i run the program, then if i comment or delete  " hr = piIADsClass->Put( L"schemaIDGUID",_variant_t(L"{BCE8B3C4-9A94-4C34-8E76-AA4A682CBA2C}"));"  it runs well, who could tell me what is the matter with my promgram, thanks very very much:)

Reply via email to