/////////////////////////////////////////////////////////////////////////////// // IPersistStreamInit STDMETHODIMP CPropertyActionBase::Load (LPSTREAM pStm) { ULONG ulLen = 0; HRESULT hr = pStm -> Read (&ulLen, sizeof(ULONG), NULL); if (S_OK != hr) return hr; TX_ASSERT(ulLen <= _MAX_PATH); char cbBuffer[_MAX_PATH]; hr = pStm -> Read (cbBuffer, ulLen, NULL); if (S_OK != hr) return hr; return SetPropName (cbBuffer); }
int AHTMODEL::SetProp( AHTPROP *prop, char *name, char *value ) { int i,type; char tmp[32]; AHTPROP *p; p = prop; strcpy2( tmp, name, 16 ); strcase( tmp ); i = -1; type = 0; if (tstrcmp(tmp,"name")) i = 0; if (tstrcmp(tmp,"help")) i = 1; if (tstrcmp(tmp,"default")) i = 2; if (tstrcmp(tmp,"sub")) i = 3; if (tstrcmp(tmp,"sub2")) i = 4; if (tstrcmp(tmp,"min")) i = 3; if (tstrcmp(tmp,"max")) i = 4; if (tstrcmp(tmp,"prm")) i = 3; if (tstrcmp(tmp,"opt")) i = 4; if (tstrcmp(tmp,"int")) { i = 5; type = AHTTYPE_EDIT_INT; } if (tstrcmp(tmp,"double")) { i = 5; type = AHTTYPE_EDIT_DOUBLE; } if (tstrcmp(tmp,"str")) { i = 5; type = AHTTYPE_EDIT_STRING; } if (tstrcmp(tmp,"combox")) { i = 5; type = AHTTYPE_CBOX_STRING; } if (tstrcmp(tmp,"chkbox")) { i = 5; type = AHTTYPE_CHKB_INT; } if (tstrcmp(tmp,"color")) { i = 5; type = AHTTYPE_COLS_INT; } if (tstrcmp(tmp,"font")) { i = 5; type = AHTTYPE_FONT_STRING; } if (tstrcmp(tmp,"file")) { i = 5; type = AHTTYPE_FILE_STRING; } if (tstrcmp(tmp,"exec")) { i = 5; type = AHTTYPE_EXTF_STRING; } if (tstrcmp(tmp,"parts")) { i = 5; type = AHTTYPE_PARTS_INT; } if (tstrcmp(tmp,"pprop")) { i = 5; type = AHTTYPE_PARTS_PROP_STRING; } if (tstrcmp(tmp,"popt")) { i = 5; type = AHTTYPE_PARTS_OPT_STRING; } //Alertf( "%s=%s(%d)", tmp, value, i ); if ( i < 0 ) return -1; switch( i ) { case 0: SetPropName( p, value ); break; case 1: SetPropHelp( p, value ); break; case 2: SetPropDefval( p, value ); break; case 3: SetPropDefval2( p, value ); break; case 4: SetPropDefval3( p, value ); break; case 5: p->ahttype = type; break; } return i; }