Boolean bl = InitializeDirectX(mypb);
И метод InitializeDirectX, использующий DirectX:
public Boolean InitializeDirectX(PictureBox pb)
{
DispMode = Manager.Adapters[Manager.Adapters.Default.Adapter].CurrentDisplayMode;
D3Dpp = new PresentParameters();
D3Dpp.BackBufferFormat = DispMode.Format;
D3Dpp.PresentFlag = PresentFlag.LockableBackBuffer;
D3Dpp.SwapEffect = SwapEffect.Discard;
D3Dpp.PresentationInterval = PresentInterval.One; //wait for vertical sync. Synchronizes the painting with
//monitor refresh rate for smooth animation
D3Dpp.Windowed = true; //the application has borders
try
{
D3Ddev = new Device(Manager.Adapters.Default.Adapter, DeviceType.Hardware, pb.Handle,
CreateFlags.SoftwareVertexProcessing, D3Dpp);
D3Ddev.VertexFormat = CustomVertex.PositionColored.Format;
D3Ddev.RenderState.Lighting = false;
D3Ddev.RenderState.CullMode = Cull.CounterClockwise;
backTexture = TextureLoader.FromStream(D3Ddev, mymem);
scannedCloudsTexture = new Texture(D3Ddev, 512, 512, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default);
//sprite is used to draw the texture
D3Dsprite = new Sprite(D3Ddev);
return true;
}
catch
{
return false;
}
}
В строке выдается исключение:
Boolean bl = InitializeDirectX(mypb);
Исключением является FileNotFoundException:
В My Weather Station.exe возникло первое случайное исключение типа «System.IO.FileNotFoundException».
Дополнительная информация: не удалось загрузить файл или сборку «Microsoft.DirectX.Direct3DX.dll» или одну из его зависимостей. Указанный модуль не найден.
И файл Microsoft.DirectX.Direct3DX.dll действительно существует в каталоге, который я вижу для файла в ссылках. Я также не вижу в ссылках на эту dll какого-либо желтого цвета или чего-то еще, указывающего на отсутствие файла.
И раньше у меня не было исключения, так что что-то изменилось в файле dll?
System.IO.FileNotFoundException occurred
_HResult=-2147024770
_message=Could not load file or assembly 'Microsoft.DirectX.Direct3DX.dll' or one of its dependencies. The specified module could not be found.
HResult=-2147024770
IsTransient=false
Message=Could not load file or assembly 'Microsoft.DirectX.Direct3DX.dll' or one of its dependencies. The specified module could not be found.
Source=My Weather Station
FileName=Microsoft.DirectX.Direct3DX.dll
FusionLog=""
StackTrace:
at mws.ScanningClouds.InitializeDirectX(PictureBox pb)
at mws.ScanningClouds.ScanClouds_Load(Object sender, EventArgs e) in d:\C-Sharp\myprog.cs:line 179
InnerException:
Строка 179:
Boolean bl = InitializeDirectX(mypb);
И если некоторые зависимости внутри dll отсутствуют, не знаю почему, как я могу найти какие из них и если вообще?
Обновление:
Это ссылка в dotPeek файла DirectXDirect3DX.dll

И в моем проекте:

Я не понял часть блокнота в решении TS.
ОБНОВЛЕНИЕ
Это ссылки в моем файле проекта:
C:\Temp\avifilewrapper\aviFileWrapperDemo_src\AviDemo\bin\Debug\AviFile.dll
False
C:\Temp\radarscan\dlls\DLL'S\Microsoft.DirectX.DLL
True
False
C:\Temp\radarscan\dlls\DLL'S\Microsoft.DirectX.Direct3D.DLL
True
False
C:\Temp\radarscan\dlls\DLL'S\Microsoft.DirectX.Direct3DX.DLL
True
C:\Temp\csnsort\csnsort_src\NumericComparer.dll
3.5
3.5
3.5
False
..\..\..\..\New folder\Unfreez\unfreez_wrapper\Release\unfreez_wrapper.dll
..\..\..\..\Appz\zedgraph_dll_v515_1\zedgraph_dll_v515\zedgraph_dll_v5.1.5\ZedGraph.dll
Подробнее здесь: https://stackoverflow.com/questions/329 ... -directory
Мобильная версия