<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592416</guid>
        <pubDate>Wed, 12 May 2010 12:07:57 +0000</pubDate>
        <title>Исключение из HRESULT: 0x8007000B</title>
        <link>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592416</link>
        <description><![CDATA[Whitebrain: ну вообще в студии есть такое меню Отладка : и там есть &quot;начать отладку&quot; и &quot;запуск без отладки&quot; итд либо f5 и ctrl+f5 <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2010-05-12T16:11:02+04:00">12.05.10, 12:11</time></span></span><br>
hd44780 спасибо помогло..]]></description>
        <author>Whitebrain</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592318</guid>
        <pubDate>Wed, 12 May 2010 11:06:37 +0000</pubDate>
        <title>Исключение из HRESULT: 0x8007000B</title>
        <link>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592318</link>
        <description><![CDATA[hd44780: Код вроде нормальный.<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=302946&view=findpost&p=2592287'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Whitebrain &#064; <time class="tag-quote__quoted-time" datetime="2010-05-12T10:41:27+00:00">12.05.10, 10:41</time></span><div class='quote '>winmm.dll лежит в папке bin/debug/ (ну и во всех, которые там были - не помогло)</div></div><br>
Странно как-то.<br>
winmm.dll - стандартная виндозная dll, ее законное место в C:&#092;WINDOWS&#092;system32. И она там всегда есть.<br>
<br>
Зачем вы ее в свой bin/debug засунули? А в bin/Release засунуть не пытались?<br>
Удалите ее оттуда, ей там не место. Может она у вас вообще не от вашей ОС.<br>
<br>
И что значит &quot;запускать без отладки&quot;?<br>
Без студии, проводником exe-шник из каталога debug?<br>
Или проводником exe из Release?]]></description>
        <author>hd44780</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592287</guid>
        <pubDate>Wed, 12 May 2010 10:41:27 +0000</pubDate>
        <title>Исключение из HRESULT: 0x8007000B</title>
        <link>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592287</link>
        <description><![CDATA[Whitebrain: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;private void Form1_Load(object sender, EventArgs e)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[B]if (WaveNative.waveInGetNumDevs() == 0) //вылетает тут, при попытке вызова метода[/B]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;textBoxConsole.AppendText(DateTime.Now.ToString() + &quot; : В системе не обнаружено устройств для оцифровки звуковых сигналов\r\n&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;textBoxConsole.AppendText(DateTime.Now.ToString() + &quot; : Устройство для оцифровки звуковых сигналов обнаружено \r\n&quot;);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_MyWaveFormat = new WaveFormat(48000, 16, 1);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int sizeBuffer = 1000;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_MyAudioFrame = new AudioFrame(_MyWaveFormat, sizeBuffer);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_MyRecorder = new WaveInRecorder(-1, _MyWaveFormat, sizeBuffer, 3, new BufferDoneEventHandler(DataArrived));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_MyRecorderBuffer = new byte[sizeBuffer];</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_MyWaveStorage = new WaveStorage(_MyWaveFormat, sizeBuffer);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
<br>
Класс WaveNative<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">using System.Runtime.InteropServices;</div><div class="code_line">//....</div><div class="code_line">public class WaveNative</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// consts</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int MMSYSERR_NOERROR = 0; // no error</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int MM_WOM_OPEN = 0x3BB;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int MM_WOM_CLOSE = 0x3BC;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int MM_WOM_DONE = 0x3BD;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int MM_WIM_OPEN = 0x3BE;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int MM_WIM_CLOSE = 0x3BF;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int MM_WIM_DATA = 0x3C0;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int CALLBACK_FUNCTION = 0x00030000; &nbsp; &nbsp;// dwCallback is a FARPROC </div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int TIME_MS = 0x0001; &nbsp;// time in milliseconds </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int TIME_SAMPLES = 0x0002; &nbsp;// number of wave samples </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public const int TIME_BYTES = 0x0004; &nbsp;// current byte offset </div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// callbacks</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public delegate void WaveDelegate(IntPtr hdrvr, int uMsg, int dwUser, ref WaveHdr wavhdr, int dwParam2);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// structs </div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[StructLayout(LayoutKind.Sequential)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public struct WaveHdr</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public IntPtr lpData; // pointer to locked data buffer</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public int dwBufferLength; // length of data buffer</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public int dwBytesRecorded; // used for input only</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public IntPtr dwUser; // for client&#39;s use</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public int dwFlags; // assorted flags (see defines)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public int dwLoops; // loop control counter</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public IntPtr lpNext; // PWaveHdr, reserved for driver</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public int reserved; // reserved for driver</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;private const string mmdll = &quot;winmm.dll&quot;;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// WaveIn calls</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[DllImport(mmdll)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public static extern int waveInGetNumDevs();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[DllImport(mmdll)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public static extern int waveInAddBuffer(IntPtr hwi, ref WaveHdr pwh, int cbwh);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[DllImport(mmdll)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public static extern int waveInClose(IntPtr hwi);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[DllImport(mmdll)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public static extern int waveInOpen(out IntPtr phwi, int uDeviceID, WaveFormat lpFormat, WaveDelegate dwCallback, IntPtr dwInstance, int dwFlags);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[DllImport(mmdll)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public static extern int waveInPrepareHeader(IntPtr hWaveIn, ref WaveHdr lpWaveInHdr, int uSize);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[DllImport(mmdll)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public static extern int waveInUnprepareHeader(IntPtr hWaveIn, ref WaveHdr lpWaveInHdr, int uSize);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[DllImport(mmdll)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public static extern int waveInReset(IntPtr hwi);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[DllImport(mmdll)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public static extern int waveInStart(IntPtr hwi);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[DllImport(mmdll)]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;public static extern int waveInStop(IntPtr hwi);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div></ol></div></div></div></div><br>
<br>
Референсы прописаны. winmm.dll лежит в папке bin/debug/ (ну и во всех, которые там были - не помогло)<br>
Херня в том, что debug работает, а если запускать без отладки то вылетает ошибка]]></description>
        <author>Whitebrain</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592268</guid>
        <pubDate>Wed, 12 May 2010 10:27:35 +0000</pubDate>
        <title>Исключение из HRESULT: 0x8007000B</title>
        <link>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592268</link>
        <description><![CDATA[Alexus: Да, например, в дебаге ваш проект может компилиьться как x64 а в релизи как x86 или наоборот]]></description>
        <author>Alexus</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592200</guid>
        <pubDate>Wed, 12 May 2010 09:48:25 +0000</pubDate>
        <title>Исключение из HRESULT: 0x8007000B</title>
        <link>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2592200</link>
        <description><![CDATA[hd44780: Ошибка &quot;Была сделана попытка загрузить программу, имеющую неверный формат&quot; у меня возникала когда я пытался сделать DllImport x32 dll-ки в x64 винде или наоборот.<br><br>Может и здесь те же грабельки.]]></description>
        <author>hd44780</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2591878</guid>
        <pubDate>Wed, 12 May 2010 03:49:07 +0000</pubDate>
        <title>Исключение из HRESULT: 0x8007000B</title>
        <link>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2591878</link>
        <description><![CDATA[Alexus: Код метода Form1.Form1_Load из файла &quot;D:&#092;программный имитатор музыкльных устройств&#092;Имитатор музыкальных устройств&#092;Имитатор музыкальных устройств&#092;Form1.cs&quot; в студию :) <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2010-05-12T03:49:26+00:00">12.05.10, 03:49</time></span></span><br>
И отметьте там ту строку, которая №110]]></description>
        <author>Alexus</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2591744</guid>
        <pubDate>Tue, 11 May 2010 19:28:20 +0000</pubDate>
        <title>Исключение из HRESULT: 0x8007000B</title>
        <link>https://forum.sources.ru/index.php?showtopic=302946&amp;view=findpost&amp;p=2591744</link>
        <description><![CDATA[Whitebrain: При запуске приложения в режиме без отладки выскакивает вот такой мэсэдж:<br>Подробная информация об использовании оперативной <br>(JIT) отладки вместо данного диалогового <br>окна содержится в конце этого сообщения.<br><br>************** Текст исключения **************<br>System.BadImageFormatException: Была сделана попытка загрузить программу, имеющую неверный формат. (Исключение из HRESULT: 0x8007000B)<br>   в Имитатор_музыкальных_устройств.WaveNative.waveInGetNumDevs()<br>   в Имитатор_музыкальных_устройств.Form1.Form1_Load(Object sender, EventArgs e) в D:&#092;программный имитатор музыкльных устройств&#092;Имитатор музыкальных устройств&#092;Имитатор музыкальных устройств&#092;Form1.cs:строка 110<br>   в System.Windows.Forms.Form.OnLoad(EventArgs e)<br>   в System.Windows.Forms.Form.OnCreateControl()<br>   в System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)<br>   в System.Windows.Forms.Control.CreateControl()<br>   в System.Windows.Forms.Control.WmShowWindow(Message&amp; m)<br>   в System.Windows.Forms.Control.WndProc(Message&amp; m)<br>   в System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)<br>   в System.Windows.Forms.ContainerControl.WndProc(Message&amp; m)<br>   в System.Windows.Forms.Form.WmShowWindow(Message&amp; m)<br>   в System.Windows.Forms.Form.WndProc(Message&amp; m)<br>   в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)<br>   в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)<br>   в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br>но если запускать в режиме отладки то ошибок нету ....как решить данную проблему? :wall:  :no-sad:]]></description>
        <author>Whitebrain</author>
        <category>.NET: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	