|
Karthik Reddy wrote: I also dont want to use this Visual Basic, but client wants to develop app in vb6
Since when do clients dictate which language we use? Does your client know the implications of this choice? Do they understand that there will be almost zero support?
If the client tells you that "strings" are bad, would you try to create a program that doesn't use strings?
Karthik Reddy wrote: let me know if you have an answer to this .
It's a generic error, and usually it includes the classname. It'll be caused by "any" of the components not being registered correctly, with MDAC being the prime suspect. You'd need to install the exact same version of the libraries that you developed against.
Hence the pointer to the VB6-Toolkit from Microsoft; it also explains what needs to be deployed and how, and the most common pitfalls. It's free to download, and it's created to help with mixing VB/.NET.
And again; if you are using .NET already, you'd have the dependency anyway. Why not write the whole thing in a modern language?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
The client has asked in vb6, if we guys develop in VB.NET then there is no point that we are serving the clients with their requirements.
And i don't understand that what should be the best version of MDAC to be installed on the machine. I've the latest 2.8.
Mr.Eddy Vluggen I can see my component in COM, still do I need to register my component with 'regsvr32' ?
|
|
|
|
|
Karthik Reddy wrote: The client has asked in vb6, if we guys develop in VB.NET then there is no point that we are serving the clients with their requirements.
You mentioned VS2010; sounds like you are already developing in .NET - what language is the component written in? And yes, I expect you to understand "why" the client proposes the requirement, as opposed to simply agreeing. Keep in mind that you're the programmer, you are the one who knows what the language-choice implicates, and YOU are the one responsible for using it.
Karthik Reddy wrote: Mr.Eddy Vluggen I can see my component in COM, still do I need to register my component with 'regsvr32' ?
Yes. You need to register your .NET control before you can use it in VB6.
That goes for all ActiveX controls.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
crieterion is to develop a component. We have done everything and sent to them..
After few days, all of a sudden he said he want the component to be used in vb6 applications.
Thank you for your suggestions !!
But my component is not registering with regsvr32.exe
|
|
|
|
|
Karthik Reddy wrote: After few days, all of a sudden he said he want the component to be used in vb6 applications.
I believe it's regasm[^], not regsvr. I tend to confuse them often; it's easier to search codeproject[^] for an article that has the procedure than it is to remember it after not using it for a few years. The CP-article shows all required steps, including registering.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Its working a bit now.
But error giving some error, i'll try to get rid of it.
Thanks Eddy Vluggen.
|
|
|
|
|
You're welcome
|
|
|
|
|
The component is in C#.NET in VS2010
|
|
|
|
|
Private Sub btnHostTools_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHostTools.Click
If GameActive Then
frmHostTools.Visible = True
Else
MsgBox("Please launch halo first!")
End If
End Sub
My problem is when the game isn't active it displays the message as it should, but the problem is that when the game does become active it will automatically show the form if you clicked the button when it was inactive.
How do I make it stop doing this, it's VERY annoying.
|
|
|
|
|
Disable[^] the button when it shouldn't be active. That way it won't be able to receive input (-focus).
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I have a table with student info.
It is possible for the user to enter the some
student 2 or 3 times, even if the studentId (primary Key) maybe diffirent. the first name, last name, classe ect may be the same.
If I have a student that have the same 6 fields the same I want to automatically delete them form the table remember the Student is set to auto increment.
thanks in advance
|
|
|
|
|
And your question/problem is what?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Member 9331278 wrote: It is possible for the user to enter the some student 2 or 3 times, even if
the studentId (primary Key) maybe diffirent
This may be true in your applications, but not in mine. If you're running into this, you did something very wrong, or not at all, during validation and data integrity checking before you wrote the record to the database.
Oh, you didn't check for duplicate data entered before you added the record?? Huh, that would explain why you've got this problem now, wouldn't it?
|
|
|
|
|
Member 9331278 wrote: It is possible for the user to enter the some
student 2 or 3 times, even if the studentId (primary Key) maybe diffirent. the first name, last name, classe ect may be the same.
Normalize your dataset; if an autonumber-key would solve all those structural problems, Access would have been a first-class development environment.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I am using Sql not access
can anyone help
|
|
|
|
|
The same advice applies; normalize your dataset to PREVENT this from happening in the first place.
Google for "SQL remove duplicates".
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
There is a article in here that has a class that puts a wrapper around "Lame.exe" so you can use Lame to convert .wav files to .mp3. It works great, but I cannot seem to get it to loop through a directory and convert all files in that directory. Does anyone know how to do it with this method, or have another way of doing it?
|
|
|
|
|
Do you use this:
VB.NET LameMP3 Shell[^]?
If so you would have to create a new instance of your converter for each file you are trying to convert. WAV to MP3 is quite math heavy to do, so I'd guess it would take quite a while to complete the convertion...
|
|
|
|
|
I do use that. Can you help me with a little example of what you mean? Also, do you know a easier way to do it, or do you think this is the best?
|
|
|
|
|
Use the Directory.GetFiles [^] method. There's an example on the same page on how to use it.
Call your convert-method foreach item that you encounter.
iismoove wrote: Also, do you know a easier way to do it, or do you think this is the best?
I like forking, and I don't mind the overhead compared to a thread. No, it's not the "best" way, because it'll be hard to display some progress, the user might think that your software is "stuck" somewhere and decide to terminate it.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
What do you mean by "forking"? I am kind of new to programming, so please excuse my ignorance. I got the code to work, but like you said it seems to "hang". I also noticed that there are about 20 or so instances of "lame.exe" running in the task manager, so the machine becomes very slow and sluggish.
|
|
|
|
|
iismoove wrote: What do you mean by "forking"?
Applications sometimes do multiple stuff at once; in that case you often need threading. I'm more of a fan of "forking", where one runs an executable and fetches the result. An independent executable can be tested without the rest of the crap, makes maintenance a bit easier.
iismoove wrote: I also noticed that there are about 20 or so instances of "lame.exe" running in the task manager
Aight, that means it works. It's best not to start all 20 conversions at once, but one after another. You're probably using the Process class to launch those, and you'd have to wait after launching until it is done before moving on to the next one.
Call the Process.WaitForExit [^] method in your loop to block execution until the external application finishes.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I am using LameShell from Qualtar. I was looking through it, because i think that just has
Process.Start instead of waitforexit(). In the LameReader function there is a _lameProcess.Start() and I tried to change it to _lameProcess.WaitForExit, but then i get a error that there is no process.
|
|
|
|
|
Aw, that means that you'll probably have to modify the lame-code. The Process.Start function returns an object of the class "Process"; you'd call the WaitForExit method on that object. Something similar to the code below;
Dim p as Process = Process.Start("Notepad")
p.WaitForExit()
Hope it works
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Yea, I cannot find anything in the class that looks like that. Maybe you can? I posted Below:
Option Explicit On
Imports System.Diagnostics
Imports System.Text.RegularExpressions
Public Class LameShell
Private _lameProcess As Process
Private _lameThread As System.Threading.Thread
Private _percentDone As Integer
Private _isRunning As Boolean = False
Private _startInfo As New ProcessStartInfo
Private Shared _regLine As Regex = New Regex( _
"(\d+)/(\d+)\D+(\d+)\D+([\d:]+)\D+([\d:]+)\D+([\d:]+)\D+([\d:]+)\D+([\d\.]+)\D+([\d:]+)", _
RegexOptions.IgnoreCase _
Or RegexOptions.CultureInvariant _
Or RegexOptions.IgnorePatternWhitespace _
Or RegexOptions.Compiled _
)
Private _inFile As String
Private _outFile As String
Private _options As String
Public Event Done()
Public Event Progress(ByRef Progress As LameProgress)
Public Event IgnoredLine(ByVal Line As String)
Public Event Canceled()
Public Sub New()
DefStartInfo()
_startInfo.WorkingDirectory = Application.StartupPath
End Sub
Public Sub New(ByVal InFile As String, Optional ByVal OutFile As String = "", Optional ByVal Options As String = "", Optional ByVal LamePath As String = Nothing)
DefStartInfo()
If LamePath = Nothing Then
_startInfo.WorkingDirectory = Application.StartupPath
End If
_inFile = InFile
_outFile = OutFile
_options = Options
End Sub
Private Sub DefStartInfo()
_startInfo.FileName = "lame.exe"
_startInfo.UseShellExecute = False
_startInfo.RedirectStandardOutput = True
_startInfo.RedirectStandardError = True
_startInfo.CreateNoWindow = True
End Sub
Public Property InFile() As String
Get
Return _inFile
End Get
Set(ByVal Value As String)
_inFile = Value
End Set
End Property
Public Property OutFile() As String
Get
Return _outFile
End Get
Set(ByVal Value As String)
_outFile = Value
End Set
End Property
Public Property Options() As String
Get
Return _options
End Get
Set(ByVal Value As String)
_options = Value
End Set
End Property
Public Property LamePath() As String
Get
Return _startInfo.WorkingDirectory
End Get
Set(ByVal Value As String)
_startInfo.WorkingDirectory = Value
End Set
End Property
Private Sub Reset()
Dim arguments As String
_percentDone = 0
_lameProcess = New Process
If _options <> "" Then
arguments = _options & " "
End If
arguments &= """" & _inFile & """ "
If _outFile <> "" Then
arguments &= """" & _outFile & """"
End If
_startInfo.Arguments = arguments
_lameProcess.StartInfo = _startInfo
End Sub
Public Function Start() As Boolean
If _isRunning Or _inFile = "-" Or _outFile = "-" Then Return False
_isRunning = True
Reset()
Try
_lameThread = New System.Threading.Thread(AddressOf LameReader)
_lameThread.IsBackground = True
_lameThread.Name = "LameReader"
_lameThread.Start()
Return True
Catch ex As Exception
Return False
End Try
End Function
Private Sub LameReader()
Dim m As Match
Dim oneLine As String
Try
_lameProcess.Start()
oneLine = _lameProcess.StandardError.ReadLine()
While Not oneLine Is Nothing
m = _regLine.Match(oneLine)
If m.Success Then
_percentDone = CType(m.Groups.Item(3).Value, Integer)
RaiseEvent Progress(New LameProgress(m))
Else
RaiseEvent IgnoredLine(oneLine)
End If
oneLine = _lameProcess.StandardError.ReadLine()
End While
_lameProcess.Close()
_lameProcess = Nothing
If _percentDone = 100 Then
RaiseEvent Done()
Else
RaiseEvent Canceled()
End If
Catch ex As Exception
If Not _lameProcess Is Nothing Then
_lameProcess.Close()
_lameProcess = Nothing
End If
MsgBox(ex.Message & vbNewLine & "Are you sure lame.exe is here:" & vbNewLine & _startInfo.WorkingDirectory)
Finally
_isRunning = False
End Try
End Sub
Public Sub Cancel()
Try
If Not _lameProcess Is Nothing Then
_lameProcess.Kill()
End If
Catch ex As Exception
End Try
End Sub
End Class
Public Class LameProgress
Private _m As Match
Public ReadOnly Property FrameCurrent() As Integer
Get
Return CType(_m.Groups.Item(1).Value, Integer)
End Get
End Property
Public ReadOnly Property FrameMax() As Integer
Get
Return CType(_m.Groups.Item(2).Value, Integer)
End Get
End Property
Public ReadOnly Property PercentDone() As Integer
Get
Return CType(_m.Groups.Item(3).Value, Integer)
End Get
End Property
Public ReadOnly Property CPUTime() As String
Get
Return _m.Groups.Item(4).Value()
End Get
End Property
Public ReadOnly Property CPUEstimate() As String
Get
Return _m.Groups.Item(5).Value()
End Get
End Property
Public ReadOnly Property REALTime() As String
Get
Return _m.Groups.Item(6).Value()
End Get
End Property
Public ReadOnly Property REALEstimate() As String
Get
Return _m.Groups.Item(7).Value()
End Get
End Property
Public ReadOnly Property PlayCPU() As Single
Get
Return CType(_m.Groups.Item(8).Value, Single)
End Get
End Property
Public ReadOnly Property ETA() As String
Get
Return _m.Groups.Item(9).Value()
End Get
End Property
Public Sub New(ByVal m As Match)
_m = m
End Sub
End Class
|
|
|
|