M
Mad Scientist Jr
Can someone convert this code to vb.net?
it is a voice recorder for pocket pc.
many thanks !
source:
http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=62
the code:
using System;
using System.Data;
using System.Runtime.InteropServices;
/// <summary>
/// Creates an instance of the shell voice recorder
/// </summary>
public class VoiceRecorder
{
//API Declares
[StructLayout(LayoutKind.Sequential)]
protected unsafe struct CM_VOICE_RECORDER
{
public int cb;
public uint dwStyle;
public int xPos, yPos;
public IntPtr hwndParent;
public int id;
public String lpszRecordFileName;
};
[DllImport("voicectl.dll", CallingConvention=CallingConvention.Cdecl)]
private static extern IntPtr VoiceRecorder_Create(ref CM_VOICE_RECORDER
voicerec);
//end api delcare
private CM_VOICE_RECORDER voicerec;
private IntPtr handle;
public unsafe VoiceRecorder()
{
voicerec = new CM_VOICE_RECORDER();
handle = new IntPtr();
voicerec.cb = (int)Marshal.SizeOf(voicerec);
voicerec.lpszRecordFileName = \\My Documents\\VoiceControl.wav;
voicerec.xPos = -1;
voicerec.yPos = -1;
}
//show the voice recorder
public void Show()
{
handle = VoiceRecorder_Create(ref voicerec);
it is a voice recorder for pocket pc.
many thanks !
source:
http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=62
the code:
using System;
using System.Data;
using System.Runtime.InteropServices;
/// <summary>
/// Creates an instance of the shell voice recorder
/// </summary>
public class VoiceRecorder
{
//API Declares
[StructLayout(LayoutKind.Sequential)]
protected unsafe struct CM_VOICE_RECORDER
{
public int cb;
public uint dwStyle;
public int xPos, yPos;
public IntPtr hwndParent;
public int id;
public String lpszRecordFileName;
};
[DllImport("voicectl.dll", CallingConvention=CallingConvention.Cdecl)]
private static extern IntPtr VoiceRecorder_Create(ref CM_VOICE_RECORDER
voicerec);
//end api delcare
private CM_VOICE_RECORDER voicerec;
private IntPtr handle;
public unsafe VoiceRecorder()
{
voicerec = new CM_VOICE_RECORDER();
handle = new IntPtr();
voicerec.cb = (int)Marshal.SizeOf(voicerec);
voicerec.lpszRecordFileName = \\My Documents\\VoiceControl.wav;
voicerec.xPos = -1;
voicerec.yPos = -1;
}
//show the voice recorder
public void Show()
{
handle = VoiceRecorder_Create(ref voicerec);