Jump to content
Xtreme .Net Talk

creightonsmith

Members
  • Posts

    3
  • Joined

  • Last visited

creightonsmith's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Maybe a problem with ACT Contact Manager According to the discussion found at the link below, a Microsoft Representative is saying it may be something caused when ACT is installed. The user found that uninstalling ACT fixed the problem. A link to the discussion is below for your reference. http://www.dotnet247.com/247reference/msgs/20/101682.aspx
  2. Thanks! Thanks, with your help and some more investigation I discovered that there were a couple of issues with my code above. The first is that in .Net the Longs in the DLL Declare should be changed to Integer when calling from vb.net. The other interesting thing, and I don't completely understand it, but apparently to get an accurate return string, you need to pass a fixed length string, which was accomplished using the stringbuilder code submitted above. The other thing that appears to be important is that when passing a string to an asyncronous DLL, it is possible that when the DLL attempts to use the string represeting the file path to save the file that the string variable could already be collected by the garbage collector. The following addition to Derek's code declaration prevents this problem: Dim sInput As New String = "play C:\Test.wav" Considering the limited support for recording in the .Net framework, I hope these findings are helpful to others. Thanks to Derek and dynamic_sysop.
  3. I am using the winmm.dll to do some simple sound recording in vb.net. I am able to get the DLL to work like a charm by sending a string in quotes, but after many different attempts am having no luck when I pass a string variable as described below. Per the MSDN instructions for calling Win32 API functions from .net I have done the following: First I declare a wrapper class Imports System.Runtime.InteropServices Public Class DLLWrapper ' Declare API to work with Windows MCI Command Declare Auto Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal _ lpstrCommand As String, ByVal lpstrReturnString As String, _ ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long End Class Then I create the class and call the function using the described parameters. If I do this I have no problems: clsDLLWrapper.mciSendString("save libedit C:\Test.wav", 0&, 0, 0) When I pass the string variable like this it doesn't work: Dim strVariable As String strVariable = "save libedit C:\Test.wav" clsDLLWrapper.mciSendString(strVariable, 0&, 0, 0) I have tried a few things including changing the Charset of the function to ANSI, AUTO etc. Any help would be much appreciated as I don't want to have to fix my file path for file recording. Thanks!
×
×
  • Create New...