|
It [^] looks promising.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I must be really new to this but when I convert that program to vb .net where do I get the namespace TestBase64?
You don't have a vb .net example do you with all the necessary imports?
Thanks.
|
|
|
|
|
I am looking for a way to count identical items in a listbox.
f.i. if the listbox has 3 the same items listed, the counter should give the value of 3.
|
|
|
|
|
The question shouold be why multiple itmes were put into the ListBox in the first place. It's easier to check to see if the same object is already in the collection before you add it.
|
|
|
|
|
Hi guys,
I need the fastest way to use live audio input (like from a mic or line-in) in VB.Net
(and also determine the frequnecy of the input at any time. and if possible raise events on frequency changes)
Thanks!
|
|
|
|
|
I don't know of any component that can do what you want. You could write one yourself though. Finding the freqency range the single is in wouls be done using a Fast Fourier Transformation implementation. Just Google for it, there's tons of examples.
|
|
|
|
|
Hi all,
I'm developing in Visual Studio 2003, and have created a 'middle layer' assembly in VB.NET to provide a security layer between a calling application and a database.
Namespace MiddleLayer<br />
<br />
Public Class DataAccessLayer<br />
' Perform the database operations in here<br />
Public Function ExecuteSQLCommand(ByRef cmd As SqlClient.SqlCommand) As Boolean<br />
'Code here<br />
End Function<br />
End Class<br />
<br />
Namespace BusinessLogicLayer<br />
Namespace Tables<br />
Public Class Part<br />
Inherits DataAccessLayer<br />
<br />
Public Function INSERT(ByVal Part_Name As String) As Boolean <br />
' Create the SQL command object and pass to ExecuteSQLCommand<br />
End Function<br />
End Class<br />
End Namespace<br />
End Namespace<br />
End Namespace
The calling application, e.g. windows application, creates a new instance of the middle layer, and can call a function such as INSERT which will INSERT a new part into the database. E.g, calling from a VB.NET windows form...
Dim part As New TestResultsDatabaseMiddleLayer.MiddleLayer.BusinessLogicLayer.Tables.Part
part.INSERT("New part")
The functionality works fine, my issue is to do with when I call the function from a C++ application, e.g. a C++ Windows Form. The code is as follows...
TestResultsDatabaseMiddleLayer::MiddleLayer::BusinessLogicLayer::Tables::Part *part = New TestResultsDatabaseMiddleLayer::MiddleLayer::BusinessLogicLayer::Tables::Part<br />
part->INSERT("New part")
Again, functionally this works fine again. The issue is that Intellisense works differently between the two. When calling from VB.NET, after I type part.INSERT( intellisense will pop up and say "Part_Name As String" as the parameter. However, when I do part->INSERT( in C++ all I get is "System::String__gc*" - I.e, it doesn't actually tell me the parameter name.
The inention is to distribute the .NET assembly to some users around site, so they can write entries to the database. I develop in VB.NET but others develop in C++.NET and other .NET languages. Unless they know what the parameter names are, they cannot accurately write to the database unless I provide them with a database schema. This is fine, but I'd like to know If I don't have to do this?
Thanks in advance,
Ynyr Jones
|
|
|
|
|
VB.NET 2002 and 2003 doesn't support generating the XML files needed to describe the code to Intellisense. You need something like the old VBCommenter tool to do this. It was an open source project that has seemingly disappeared into the ether, but you might find it in this[^] pack somewhere. I don't konw for sure though...
The XML generation is built into VB.NET 2005 and above, so you MAY want to consider upgrading top a newer version.
|
|
|
|
|
Hi
I am new to VB.net wanted to know how to play wave audio files one after another? I tried a code by giving file names one after another. Here the last file plays. The first file is not playing. I think its too fast! How to control it. I have a class called soundplayer. The code is as follows
Imports System
Imports DxVBLib
Public Class SoundPlayer
' Basic Wave and MIDI Player Class for VB.net 1.1
' Requires COM-Object : DirectX7
Private Declare 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
Private File As String
Private m_dx As New DirectX7()
Private m_ds As DirectSound
Public Sub New(ByVal strFileName As String)
Me.File = strFileName
End Sub
' To show what file is selected (if needed)
Public ReadOnly Property FileName() As String
Get
Return File
End Get
End Property
Public Function PlaySound() As Boolean
If InitAudio() = True Then
If PlayFile() = True Then
Return True
Else
Return False
End If
Else
' Audiohardware not found
' exit here
Return False
End If
End Function
Public Function StopSound() As Boolean
StopFile()
End Function
Private Function PlayFile() As Boolean
Dim lRet As Long
Try
StopFile()
lRet = mciSendString("open " & Me.File & " alias track", "", 0, 0)
lRet = mciSendString("play track", "", 0, 0)
PlayFile = (lRet = 0)
Catch ex As Exception
Return False
End Try
Return True
End Function
Public Function CloseAudio()
mciSendString("close all", 0, 0, 0)
End Function
Private Function StopFile() As Boolean
Dim lRet As Long
Try
lRet = mciSendString("stop track", "", 0, 0)
lRet = mciSendString("close track", "", 0, 0)
Return True
Catch ex As Exception
Return False
End Try
End Function
Private Function InitAudio() As Boolean
m_ds = m_dx.DirectSoundCreate("")
If Err.Number <> 0 Then
Return False
Else
Return True
End If
End Function
End Class
in the form I have written the following code
Public Class frmIVA
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
'
'frmIVA
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Name = "frmIVA"
Me.Text = "Interactive"
End Sub
#End Region
Private Sub frmIVA_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim fileName As String
fileName = "welcome.wav"
Play(fileName)
fileName = "zodmon.wav"
Play(fileName)
fileName = "press12.wav"
Play(fileName) End Sub
Public Sub Play(ByVal file)
Dim pathName As String = "E:\iva\audio\"
Dim Sound As New SoundPlayer(pathName & file)
Sound.PlaySound()
End Sub
End Class
Please Help
Thanks in Advance
|
|
|
|
|
meghanaVishwa wrote: fileName = "zodmon.wav"
Play(fileName)
fileName = "press12.wav"
Play(fileName)
Obviously, this will change the file right away. I don't know if the code you're using supports an event when playback ends, but the windows media player control and the managed directx classes for playing audio, both do, and the WMP control lets you build a playlist, also.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Guys,
Does anyone of you know where can I download Sheridan Ultragrid 1.0 installer for visual basic 6?
Thanks in advance
hifiger2004
|
|
|
|
|
Normally I'd assume you were trying to steal this component, but in this case, I assume that it's not longer available because VB6 is a dead language, and has been for many years. Why are you still using it ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have my old VB6 source code that uses sheridan which is very important because there's I have a small client who's currently using my program. He called me up and informed me that his pc was just reformatted and need to reinstall the entire program from the CD I gave him 4 years ago. And my problem now is that I don't have my sheridan installer anymore.
That's why I am trying to search for a sheridan installer inorder for me to reinstall back my program into his computer.
I acquired the Sheridan installer from a friend before, but when I contacted him now his mobile# is unreachable.
So meaning, there's no other site now that distributes trial version?
Because if there's only a trial version, I can easily get into my source code and for me to have a chance to change it to other native components in VB6. The important thing for me now is to trace back the functionalities thru the use of sheridan component before moving to the next step.
Thanks
hifiger2004
|
|
|
|
|
I don't know, you'd have to google for it. It would not surprise me, but then, why not keep selling it, it costs nothing to keep it on the inventory.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi.
this is my first post here on code project, but i already read many articles. i believe this is the right place to ask my question.
here is the interface which is implemented in the product class:
Public Interface IGridMarkable
ReadOnly Property sort() As Short
Property valid() As SqlBoolean
ReadOnly Property pflicht() As Boolean
End Interface
Now I have another class with a method setref(byref Dictionary(of short, IGridMarkable)).
When i try to call this method this method like this:
dim list as dictionary(of short, product)
anotherclassobject.setref(list)
the compiler tells me that this can not be converted. ctype(list,dictionary(of short, IGridMarkable)) doesn't work either.
can anyone explain me this behaviour?
--edit
Is it possible to define the conversion from product to IGridMarkable in the product class?
--edit
thanks in advance,
steffen.
modified on Thursday, March 6, 2008 4:13 AM
|
|
|
|
|
I'm surprised, I'd have expected you could do this.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi christian.
i thought that too.
steffen.
|
|
|
|
|
Are you absolutely sure the Product class Implements IGridMarkable??
|
|
|
|
|
hello dave.
see for yourself (i shortened it down to the necessary things)
Public Interface IGridMarkable
ReadOnly Property sort() As Short
Property valid() As SqlBoolean
ReadOnly Property must() As Boolean
End Interface
Public Class product
Implements IGridMarkable
#Region "private member vars"
Private _sort As Long
Private _valid As SqlBoolean = SqlBoolean.Null
Private _must As Boolean
#End Region
#Region "properties"
Public ReadOnly Property sort() As Short Implements IGridMarkable.sort
Get
Return Me._sort
End Get
End Property
Public ReadOnly Property must() As Boolean Implements IGridMarkable.must
Get
Return _must
End Get
End Property
Public Property valid() As SqlBoolean Implements IGridMarkable.valid
Get
Return _valid
End Get
Set(ByVal value As SqlBoolean)
#If DEBUG Then
Debug.WriteLine("Produkt: " + Me.sort.ToString + " valid: " + value.ToString)
#End If
_valid = value
End Set
End Property
#End Region
End Class
Could it be that the problem lies in trying to cast the collection instead of one single product?
steffen.
|
|
|
|
|
OK. I just tried this and it failed. I, too, would have thought this should have worked.
Hmmm.... still playing around with this one.
OK. It looks like you're going to have to create the list Dictionary using IGridMarkable , not Product :
Dim list As New Dictionary(Of Short, IGridMarkable)
list.Add(some short, New Product())
someClass.setRef(list)
The type cast won't work because the Dictionary is, internally, a collection of KeyValuePair(Of type, type) objects, which the type cast won't transfer to.
|
|
|
|
|
i'll try this when i'm back at work. my problem is that i work with this dictionary application wide, where the IGridMarkable-propertys of the product are changed. But I need the "normal" product propertys too. Maybe I could just make another Dictionary(of short, IGridMarkable) where i add references to the real products, but this is a waste of memory.
well, thank you, i'll go home now.
|
|
|
|
|
hello all.
i won't be at work the next 2 weeks, so don't be suprised if i don't answer.
thank you for your efforts.
steffen.
|
|
|
|
|
Working in VB.Net, Visual Studio 2000 Standard, Windows XP Pro.
Using a 3rd party video editor ActiveX control.
Have 3 forms in the program using this control. First time one of the forms is opened, the ActiveX control performs correctly. After the form is closed, attempting to open any of the 3 forms with this control throws an exception error:
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in system.windows.forms.dll
Additional information: Unable to get the window handle for the 'AxVideoEdit' control. Windowless ActiveX controls are not supported.
The line in the program VisualStudio stops at is located in the "Windows Form Designer generated code" section for the details on the form being opened:
CType(Me.vidEdit, System.ComponentModel.ISupportInitialize).EndInit()
(vidEdit is the VideoEdit ActiveX control)
Following is the error message details when running the actual program:
************************************************
************************************************
************************************************
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Reflection.TargetInvocationException: Unable to get the window handle for the 'AxVideoEdit' control. Windowless ActiveX controls are not supported. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Forms.IOleObject.DoVerb(Int32 iVerb, IntPtr lpmsg, IOleClientSite pActiveSite, Int32 lindex, IntPtr hwndParent, COMRECT lprcPosRect)
at System.Windows.Forms.AxHost.DoVerb(Int32 verb)
at System.Windows.Forms.AxHost.InPlaceActivate()
--- End of inner exception stack trace ---
at System.Windows.Forms.AxHost.InPlaceActivate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.AxHost.EndInit()
at MyProgram.VidEdit.InitializeComponent()
at MyProgram.VidEdit..ctor()
at MyProgram.StartProgram.lblClipEdit_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/windows/microsoft.net/framework/v1.0.3705/mscorlib.dll
----------------------------------------
ActionPlusVideo
Assembly Version: 1.0.2980.30757
Win32 Version: 1.0.2980.30757
CodeBase: file:///C:/Program%20Files/MyProgram/MyProgram.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/windows/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
AxInterop.VIDEOEDITLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/MyProgram/AxInterop.VIDEOEDITLib.DLL
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.3300.0
Win32 Version: 7.00.9466
CodeBase: file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.3300.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
Interop.VIDEOEDITLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/MyProgram/Interop.VIDEOEDITLib.DLL
----------------------------------------
AxInterop.MOVIEPLAYERLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/MyProgram/AxInterop.MOVIEPLAYERLib.DLL
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
************************************************
************************************************
************************************************
Have tried using the forms with and without vidEdit.Dispose(), MyBase.Dispose(), etc., but no success.
Any suggestions?
|
|
|
|
|
Sounds like it's not supported. What control do you use ? I use the Datastead TVideoGrabber, and it's worked out really well, and their support is excellent.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Using Viscom's VideoEdit ActiveX.
The error report shows there is no instance of the ActiveX control to access, but it works fine the first time through. The com wrapper is being lost somehow when closing the form and not being reproduced when another instance of the ActiveX control is called for. Any answers on why this could be happenning and how to prevent it?
|
|
|
|
|