<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: вызов API-функции GetSystemTime через DynamicWrapperX]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=2409&amp;type=atom" />
	<updated>2008-11-02T11:20:56Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=2409</id>
		<entry>
			<title type="html"><![CDATA[VBScript: вызов API-функции GetSystemTime через DynamicWrapperX]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=15452#p15452" />
			<content type="html"><![CDATA[<p><a href="http://www.script-coding.com/dynwrapx.html">DynamicWrapperX</a>.<br />Для возвращаемой структуры придётся использовать строку, а API-функции передать указатель на неё. Члены структуры можно задать как смещения от её начала.<br /></p><div class="codebox"><pre><code>wYear = 0
wMonth = 2
wDayOfWeek = 4
wDay = 6
wHour = 8
wMinute = 10
wSecond = 12
wMilliseconds = 14

Set DX = CreateObject(&quot;DynamicWrapperX&quot;)

DX.Register &quot;kernel32&quot;, &quot;GetSystemTime&quot;, &quot;i=p&quot;  &#039; Функция получит указатель.

mySysTime = Space(8) &#039; Буфер под структуру, 8 * 2 = 16 байт.

DX.GetSystemTime mySysTime

&#039; Считывание полей структуры в переменные.

aYear = DX.NumGet(mySysTime, wYear, &quot;t&quot;)
aMonth = DX.NumGet(mySysTime, wMonth, &quot;t&quot;)
aDay = DX.NumGet(mySysTime, wDay, &quot;t&quot;)

MsgBox aDay &amp; &quot;.&quot; &amp; aMonth &amp; &quot;.&quot; &amp; aYear</code></pre></div><p>Автор примера - <strong>YMP</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2008-11-02T11:20:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=15452#p15452</id>
		</entry>
</feed>
