|
Thanks, I didn't know about this one. It seems to be exactly what I need.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Several weeks ago you folks helped me with a problem and I have another problem I hope you can help with.
I created, with your help, a small program that spun three will like a slot machine and randomly placed 2 values and a sign, in picture boxes to create a very basic math problem to be solved. I did this for my 6 year old granddaughter and she LOVES IT!.
In fact she took the program to school and the teacher loved it as well. After a little work I jazzed up the program with some flashy graphics and sound. She wants to add the program to her teaching library. Before I give her a copy I wanted to add some animation to the reels by adding short AVI files. Creating the files was no problem, getting them to play was.
Can anyone steer me to some actually complete code that will play a AVI file in a picture box, that IS DOCUMENTED with remark statements so I can see what they are doing in the code.
On the same note is there a format the AVI file must be in to play? I learned that to play a wave file using the Autoplaymode function the wave file had to be in PCM format. Is there some such requirement for AVI files?
Thanks for your help
|
|
|
|
|
How do I make an os in vb2010 help tanks
|
|
|
|
|
You probably don't. However, there are plenty of articles around on writing your own OS, take a look here[^], or try Google.
|
|
|
|
|
You don't.
You're welcome.
Bastard Programmer from Hell
|
|
|
|
|
If you're going to call yourself "code master", you better know what you're doing and why this is a bad idea.
Can it be done? Yeah, but with extreme difficulty. Check out Cosmos[^], a (mostly) C# written OS.
|
|
|
|
|
A very tall order there. You probably can make an OS in VB, but why? In the development of an OS, there's too much that goes on to just post.
""Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
No you can't; all you can make in a higher-level language is a virtual OS, one that runs on top of a real one. For a real OS, one needs pre-emptive scheduling which requires access to all the CPU registers, so one can swap one process/task/thread for another one, saving/restoring the state in some data structures. C#, Java, VB and other HLL's don't provide access to (all relevant) CPU registers.
I've constructed a number of OSes using C; it takes one or two pages of assembly code at least to implement proper process/task/thread switching. Everything else could be implemented in the HLL, although optimal interrupt handling may beg for some assembly code too.
One could argue that in-line assembly could be used (probably not in VB), but I would not really consider that as the compiler will insist on adding some code I don't want, and performance should not be wasted in task switching or interrupt servicing.
|
|
|
|
|
Luc Pattyn wrote: all you can make in a higher-level language is a virtual OS
Very true.
""Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
In VB, that would be called a 1s. 0s are made in C#.
|
|
|
|
|
I'm googled all day long and can't seem to find a good example of this. I'm trying to write a VB.NET Windows Form Application to submit a XML request to a web service via a POST to a URL. And get the response. I've found plenty for VB6 but these don't work for Visual Studio. Can someone point me in the right direction? Thanks
|
|
|
|
|
Member 7743805 wrote: found plenty for VB6 but these don't work for Visual Studio
Have you tried to make the appropriate changes to VB.Net if possible?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Maybe this will help ...
I've cut & Pasted some of the relevant code and had to make a few changes to obfuscate the server and other proprietary business logic.
I'm very new to the webservice arena so this might not be the best way to implement it, but it is working for me.
The idea is that a salesman can make a webService request for a Product price quote.
sURL = "http://myServer/myApp/TQWebService.asmx?op=CreateQuoteRequest"
WRequest = WebRequest.Create(sURL)
WRequest.Method = "POST"
WRequest.Credentials = System.Net.CredentialCache.DefaultCredentials
SOAPdata = BuildSoapTQRequest(Salesman, ProductCode)
WRequest.ContentType = "application/soap+xml; charset=utf-8"
WRequest.ContentLength = SOAPdata.Length
postStream = WRequest.GetRequestStream()
postStream.Write(SOAPdata, 0, SOAPdata.Length)
postStream.Close()
Try
WResponse = WRequest.GetResponse()
responseStream = WResponse.GetResponseStream
Dim sr As New StreamReader(responseStream)
xDoc.LoadXml(sr.ReadToEnd)
Private Function BuildSoapTQRequest(ByVal ReqID As String, ByVal ProductCode as String) As Byte()
Dim sb As New StringBuilder
sb.Append("<soap12:Envelope xmlns:xsi=" + Chr(34) + "http://www.w3.org/2001/XMLSchema-instance" + Chr(34) + " xmlns:xsd=" + Chr(34) + "http://www.w3.org/2001/XMLSchema" + Chr(34) + " xmlns:soap12=" + Chr(34) + "http://www.w3.org/2003/05/soap-envelope" + Chr(34) + "> ")
sb.Append(System.Environment.NewLine)
sb.Append("<soap12:Body> " + System.Environment.NewLine)
sb.Append("<CreateQuoteRequest xmlns=" + Chr(34) + "http://myServer/" + Chr(34) + "> " + System.Environment.NewLine)
sb.Append("<myRequestorID>" + ReqID + "</myRequestorID>" + System.Environment.NewLine)
sb.Append("<myProductCode>" + ProductCode + "</myProductCode>" + System.Environment.NewLine)
sb.Append("</CreateQuoteRequest> " + System.Environment.NewLine)
sb.Append("</soap12:Body> " + System.Environment.NewLine)
sb.Append("</soap12:Envelope> " + System.Environment.NewLine)
Return Encoding.ASCII.GetBytes(sb.ToString)
End Function
|
|
|
|
|
I'm moving from VB6 to VS 2008. And need help with a data
structure problem.
In a Public code module in my VS 2008 project, I defined a structure:
Public structure db_connection
dim connection_string as string
End structure
Then defined a variable as the structure type:
Public db_con as db_connection
When I pass the db_con variable to a sub:
sub db_create_cs(dbc as db_connection)
dbc.connection_string = "some values"
end sub
I expected the db_con.connection_string value
to equal "some values" after the call.
Regards.
|
|
|
|
|
Check to see if in your declaration,
sub db_create_cs(dbc as db_connection)
the parameter is ByRef as opposed to ByVal.
Also, you might want to re-structure your program to define db_create_cs as a function rather than a sub. (my 2 cents)
Hope this helps.
|
|
|
|
|
ByRef cured the problem. I was going down fast. thanks
In the actual program it is a function. I slimmed down the
code for my question. Thanks for the comment though, and help.
|
|
|
|
|
If you don't specify "ByRef" or "ByVal", then the parameter is "ByVal" by default.
You want:
Sub db_create_cs(ByRef dbc As db_connection)
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
I thought I checked that. It fixed the problem.
Thanks for the help.
I sense a series of adjustments going from VB6 to
VS 2008 is ahead.
|
|
|
|
|
The problem is that for VB6, the default was "ByRef", but for VB.NET, the default is "ByVal".
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
Hello all, i have been making a few Visual Basic Applications as a bit of a hobby. Is there anyway to make an application read some files that contain code and have a program act accordingly. in other words have a add-on/plug-in system for a program.
Any help is appreciated! thanks!
|
|
|
|
|
There is a namespace in .Net called CodeDom , which can be used to compile and run code on-the-fly so to speak. If you google vb codedom you should get plenty of hits with a good tutorial.
Good Luck
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
|
|
Please help on this code. I tried to update record in datetime field in access but yields concurrency exception. Tnxs.
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
'saves edited record.
If MessageBox.Show("Sure to save record?", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.Yes Then
Dim qryTask As String = "SELECT * from tblTask where fix(task_id) = '" & id & "'"
daTask.SelectCommand = New OleDbCommand(qryTask, connection)
Dim cb As OleDbCommandBuilder = New OleDbCommandBuilder(daTask)
daTask.Fill(dsTask, "tblTask")
dtTask = dsTask.Tables("tblTask")
bolSave = True 'user saved changes.
Dim intCatId% = -1
dtTask = dsTask.Tables("tblTask")
Dim strMonth As String = Format(Me.dtpDeadline.Value, "MM")
Dim strDate As String = Format(Me.dtpDeadline.Value, "dd")
Dim strYear As String = Format(Me.dtpDeadline.Value, "yyy")
Dim strCat$ = Trim(Me.cboCategory.Text)
intCatId = udfCategoryId(strCat)
If Me.txtTask.Text = "" Or Me.txtDetails.Text = "" Then
MessageBox.Show("Please fill up Task and Task Details!", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
'check date.
If Trim(strStartTime) = "" Then
If Trim(Me.txtStartTime.Text) = "" Then
strStartTime = ""
Else
strStartTime = Trim(Me.txtStartTime.Text)
End If
ElseIf Trim(strStartTime) <> "" Then
If Trim(Me.txtStartTime.Text) = "" Then
strStartTime = ""
Else
strStartTime = strStartTime
End If
End If
''check date.
If (strEndTime) = "" Then
If Trim(Me.txtEndTime.Text) = "" Then
strEndTime = ""
Else
strEndTime = Trim(Me.txtEndTime.Text)
End If
ElseIf Trim(strEndTime) <> "" Then
If Trim(Me.txtEndTime.Text) = "" Then
strEndTime = ""
End If
End If
Try
With dtTask
.Rows(0)("Task") = IIf(txtTask.Text = "", System.DBNull.Value, txtTask.Text)
.Rows(0)("Task_Details") = IIf(txtDetails.Text = "", System.DBNull.Value, txtDetails.Text)
.Rows(0)("Task_Status") = IIf(txtStatus.Text = "", System.DBNull.Value, txtStatus.Text)
.Rows(0)("Deadline") = Format(Me.dtpDeadline.Value, "MM/dd/yyy")
.Rows(0)("Year_Deadline") = Format(Me.dtpDeadline.Value, "yyy")
.Rows(0)("Task_Category_Id") = CInt(intCatId)
.Rows(0)("Start_Time") = IIf(strStartTime = "", System.DBNull.Value, FormatDateTime(strStartTime, DateFormat.LongTime))
.Rows(0)("End_Time") = IIf(strEndTime = "", System.DBNull.Value, FormatDateTime(strEndTime, DateFormat.LongTime))
End With
daTask.Update(dsTask, "tblTask")
MessageBox.Show("Record successfully saved!", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As OleDbException
MsgBox(ex.ToString)
End Try
Else
MessageBox.Show("Record not saved.", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
|
|
|
|
|
Hello;
Please don't bother to answer this query. I found out the culprits - the same variables declared globally.
Tnxs.
|
|
|
|