   [DX11]Can't get my rendering technique! (Sometimes?!)
  I have another problem:Because I need to change my BaseShader sometimes, I don't want my artist to recompile all his shaders (Which include this BaseShader) himself. So I made a little function that does the job for him. I mostly copied the code from the compile-function of my shader editor, and it even returns S_OK, the Error-Blob is emtpy, the Shaderblob gets filled, the ID3DX11Effect creation is also right, BUT:I can't get the rendering technique!When I compile through my ShaderEditor, everything is working, but when using the Auto-Compiler, the Effect-Framework crashes because of soem variable is NULL, and the coder of it didn't test if it's not.Here is the Auto-Compiler:void RecompileShadersInPackage(WTechPackage2* Package){ID3D10Blob* ShaderBlob=NULL;ID3D10Blob*Blob_Errors=NULL;BOOST_FOREACH(WPckFileChunk* fc,Package->Files){WCHAR Ext[MAX_PATH];GetFileExt(fc->FileName,LPS Ext);if(_wcsicmp(LPS Ext,L"wfx")==0){WCHAR Src[MAX_PATH];//Find the .source filewcscpy(LPS Src,LPS fc->FileName);wcscat(LPS Src,L".source");WPckFileChunk* srcfc = Package->GetChunkByName(LPS Src);FILE* f;//Open a temp file for writing down the shader (Creating from memory doesn't works!? Or does it? Just tried this way, too)f=_wfopen(L"TempShader.fx",L"w");fwrite((char *)srcfc->GetData(),srcfc->GetSize(),1,f);fclose(f);//Precompile the fileHRESULT hr=D3DX11CompileFromFile(L"TempShader.fx", NULL, NULL,NULL, "fx_5_0",D3D10_SHADER_OPTIMIZATION_LEVEL3 | D3D10_SHADER_ENABLE_STRICTNESS, NULL, NULL, &ShaderBlob,&Blob_Errors,NULL);if(SUCCEEDED(hr)){if(Blob_Errors){MessageBoxA(NULL,(char *)Blob_Errors->GetBufferPointer(),"Error in shader!",MB_OK|MB_ICONERROR);if(ShaderBlob){ShaderBlob->Release();}if(Blob_Errors){Blob_Errors->Release();}continue;}fc->DeleteData(); //Free the old shader//We need to copy the data, because the Blob will delete it when we  release itbyte* ShaderData = new byte[ShaderBlob->GetBufferSize()];memcpy(ShaderData,ShaderBlob->GetBufferPointer(),ShaderBlob->GetBufferSize());//Set new data.fc->SetData(NULL, //Keep the old nameShaderData, //New dataShaderBlob->GetBufferSize()//Size of that data); WShader* Shd=(WShader *)fc->GetOwnedObject();if(Shd==NULL){fc->CreateOwnedObject(WSHADER);Shd=(WShader *)fc->GetOwnedObject();}Shd->CreateShaderFromFile(NULL, //No pathLPS Package->PackageName,  //Name of the packagefc->FileName, //Name of the fileShaderBlob->GetBufferPointer(), //DataShaderBlob->GetBufferSize()); //DatasizeShaderBlob->Release();}}}}This is the ShaderEditor compiler: (Sorry, thats a little mess ;) )case IDM_CompileShader:case IDM_SaveFile:CHAR cName[MAX_PATH];CHAR cBackup[MAX_PATH];WideCharToMultiByte( CP_ACP, 0, LPS ShaderEditor.LoadedFile, -1, (char *)&cName, MAX_PATH, NULL, NULL );strcpy((char *)&cBackup, SHADER_BACKUP_DIR);strcat((char *)&cBackup,(char *)&cName);SaveScintillaToFile((char *)&cName,ShaderEditor.Scintillahw); //BackupSaveScintillaToFile("TempShader.fx",ShaderEditor.Scintillahw);  //Save the Editor-Contents to a textfilePck=NULL;TheScene.PckHandler->FindPackageByName(LPS ShaderEditor.FilePackage,&Pck); //Find the right Packageif(Pck){WCHAR Source[MAX_PATH];wcscpy(LPS Source,LPS ShaderEditor.LoadedFile);wcscat(LPS Source,L".Source"); //Apply .Source, for the Package-version of the shaderID3D10Blob* ShaderBlob=NULL;ID3D10Blob*Blob_Errors=NULL;ID3D10Effect* E=NULL;//%Precompile the shader and check for errors HRESULT hr=D3DX11CompileFromFile(L"TempShader.fx", NULL, NULL,NULL, "fx_5_0",D3D10_SHADER_OPTIMIZATION_LEVEL3 | D3D10_SHADER_ENABLE_STRICTNESS, NULL, NULL, &ShaderBlob,&Blob_Errors,NULL);char* Errors;if(Blob_Errors){Errors=(char *)Blob_Errors->GetBufferPointer();if(!ShaderBlob){MessageBoxA(NULL,(char *)Blob_Errors->GetBufferPointer(),"There are errors in that fx file!",MB_OK | MB_ICONERROR | MB_TOPMOST);break;}else{MessageBoxA(NULL,(char *)Blob_Errors->GetBufferPointer(),"There are warnings in that fx file!",MB_OK | MB_ICONWARNING | MB_TOPMOST);}Blob_Errors->Release();break;}else{//InfoBox(L"Compilation succeeded!");if(ShaderBlob){//ShaderBlob->Release();}else{break;}}WPckFileChunk* fc;fc=NULL;Pck->GetChunkByID(ShaderEditor.ChunkID,&fc);if(fc){fc->DeleteData(); //Free the old shader//We need to copy the data, because the Blob will delete it when we  release itbyte* ShaderData = new byte[ShaderBlob->GetBufferSize()];memcpy(ShaderData,ShaderBlob->GetBufferPointer(),ShaderBlob->GetBufferSize());//Set new data.fc->SetData(NULL, //Keep the old nameShaderData, //New dataShaderBlob->GetBufferSize()//Size of that data); SaveScintillaToFile("TempShader.fx",ShaderEditor.Scintillahw,true); //Save again, with \r linebreaksPck->AppendFile(L"TempShader.fx",LPS Source); //Append the sourcecode for later editingWShader* Shd=(WShader *)fc->GetOwnedObject();if(Shd==NULL){fc->CreateOwnedObject(WSHADER);Shd=(WShader *)fc->GetOwnedObject();}Shd->CreateShaderFromFile(NULL, //No path  LPS Pck->PackageName,  //Name of the package  fc->FileName, //Name of the file  ShaderBlob->GetBufferPointer(), //Data  ShaderBlob->GetBufferSize()); //DatasizeD2DBrowser.RefreshCurrentPage(); //And at least, refresh the browser-page, for the case that we got a new .source file}//byte* fd;//UINT fs;//Pck->GetFile(LPS Source,&fd,&fs);//Shd->CreateShaderFromFile(NULL,LPS Pck->PackageName,LPS Source,fd,fs);//Shd->CreateShaderFromFile(L"TempShader.fx",NULL,NULL,NULL,NULL);ShaderBlob->Release();}break;It crashes at this call (Shader compiled successfully) :NormalRenderTechnique=MyShader->GetTechniqueByName("RenderTechnique"); //Get the techniquesSelectedRenderTechnique=MyShader->GetTechniqueByName("RenderSelected");Here in the Effects11 framework:ID3DX11EffectTechnique * CEffect::GetTechniqueByName(LPCSTR Name){    HRESULT hr = S_OK;    LPCSTR pFuncName = "ID3DX11Effect::GetTechniqueByName";    const UINT MAX_GROUP_TECHNIQUE_SIZE = 256;    char NameCopy[MAX_GROUP_TECHNIQUE_SIZE];    if (IsOptimized())    {   DPF(0, "ID3DX11Effect::GetTechniqueByName: Cannot get technique interfaces by name since the effect has been Optimize()'ed");   return &g_InvalidTechnique;    }    if (NULL == Name)    {   DPF(0, "%s: Parameter Name was NULL.", pFuncName);   return &g_InvalidTechnique;    }    if( FAILED( StringCchCopyA( NameCopy, MAX_GROUP_TECHNIQUE_SIZE, Name ) ) )    {   DPF( 0, "Group|Technique name has a length greater than %d.", MAX_GROUP_TECHNIQUE_SIZE );   return &g_InvalidTechnique;    }    char* pDelimiter = strchr( NameCopy, '|' );    if( pDelimiter == NULL )    {   return m_pNullGroup->GetTechniqueByName( Name ); //<-------------------- pNullGroup is NULL!    }    // separate group name and technique name    *pDelimiter = 0;return GetGroupByName( NameCopy )->GetTechniqueByName( pDelimiter + 1 );}Maybe I just forgot something...   