Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. sender.text = "Hello world" would work but more reliable if you cast sender to the correct object type.
  2. Never got chance to even look at it yesterday :( http://sunlightd.virtualave.net/Windows/DirectX.NET/DXTestVB.html has a reasonably nice article on DirectX9 and about 1/2 way down shows how to do sprites using Direct3D. I also had a problem with the MS texture sample - just pointed it to a different media file and it worked (probably missing a codec or something)
  3. sender is the object that triggered the event. i.e. If this was a button click event sender would be the button clicked by the user. This can be useful if more than one button shared the same event handler. Best way to use it is to cast it too the correct type and then you will have access to it's properties. Protected Sub TestButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TestButton.Click dim b as button b= DirectCast(sender, button) 'Can now access things like b.Text = "OK" messagebox.Show (b.Name ) 'etc. this can be useful in a scenario like below where more than one button shares the handler Protected Sub TestButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TestButton.Click, TestButton2.Click 'notice handling bothe TestButton1 and 2 in the same function. dim b as button b= DirectCast(sender, button) 'Can now access things like b.Text = "OK" messagebox.Show (b.Name ) 'etc.
  4. There is a sample chat application that comes with the .Net SDK.
  5. Not at a machine with .Net at the moment but IIRC you could add an handler for the MouseUp event and in your handler check which button was pressed.
  6. Does the website give a specific error message or just reject all non-IE web browsers. If you just want to download a web page then System.Net.WebClient could do the job - search the archives and you'll find a few good examples.
  7. How many places is the ConnectionString referenced? It probably wouldn't be that hard to convert the code.
  8. Never even saw that in the code! Should really pay more attention ;)
  9. The line Do Until (fileRead.Read = -1) is reading the first character in and ignoring it. The following should work Dim fileRead As New IO.StreamReader("C:\store.txt") Dim store As Array strRead = fileRead.ReadToEnd strRead.ToString() store = Split(strRead, " ", -1) a slightly tweaked way may be better Dim fileRead As New IO.StreamReader("C:\store.txt") Dim store() As String Dim strRead as string strRead = fileRead.ReadToEnd strRead.ToString() store = strRead.Split(" ")
  10. You can use Direct£d for 2d stuff - you just create a 2d square and texture it with the 2d sprite (plus this gives you the benefit of hardware acceleration on newer cards). I'll try and dig up a sample later, not near a PC with directX on at the moment - will knock up a sample later today if nobody beats me to it ;)
  11. Although you really should use the MessageBox.Show command under .Net messagebox.Show ("Hello " & txtName.Text & vbCrLf & "Hello From Visual Basic.NET","Hello User Message",MessageBoxButtons.OK,MessageBoxIcon.Information)
  12. This could be more of an issue as the .Net framework is available for 64 bit platforms. I fyou just want an integer that works well on the currently running platform then Integer would be a good choice as it will be Int32 on a 32 bit platform and Int64 on a 64 bit platform. If the size of the variable matters (memory usage, interop with other systems, binary files etc) then picking Int16, Int32 or Int64 (or the aliases as mutant mentioned) would be more appropriate.
  13. Under DirectX 9 they've changed how things work, all drawing now uses Direct3D (even if you only require 2D). Not sure how you would go about it just using the older DirectDraw interfaces.
  14. If you use MessageBox.Show (System.Environment.CommandLine) what does it display? Also try and display System.Environment.CommandLineArgs (0) and (1)
  15. If you've installed the DirectX SDK you should find a sample in \Samples\VB.Net\AudioVideo\Texture which renders an avi to a to a surface.
  16. try Dim sCommand As String = System.Environment.GetCommandLineArgs(1) sCommand = sCommand.ToLower() If sCommand = "-server" Then Call remote() Exit Sub End If instead - System.Environment.CommandLine returns the entire command line including the path to the application. GetCommandLineArgs() splits the commandline into an array of seperate arguments with index 0 being the application.
  17. Are you using DirectX 9 or an earlier version?
  18. you could change the line mylines(q) = New LineStuff to something like dim i as interger for i = 0 to 999 mylines(i) = new LineStuff next this would pre-create all 1000 items. This may be a bit heavy on memory unless you knew that you would always need 1000 items in the array.
  19. Not sure what you mean by 'remote control for protection' and 'remote data accessing' is a bit vague. Do you have any existing VB6 code as an example?
  20. Are you testing this from the debug environment? If so when the one and only session ends then the web application is terminated and the cache is cleared. If multiple users are accessing the web application then the cache should last (see Derek Stone's comment about memory usage above) edit : typo
  21. Not sure what the defaults are if you use Cache.Insert, try Cache.Add - this allows you to specify things like expiry times for cached items.
  22. What are you trying to do with sockets?
  23. .Net comes with a lot of built-in support for sockets. Have a look under System.Net and System.Net.Sockets. Or is there something else you require?
  24. The only item in the array that is being created is in the line mylines(q) = New LineStuff where q = 0. the loop starts with q=0 but then increments it. As soon as q=1 mylines(q) is the same as mylines(1) which is uninitialised.
  25. any chance of some code to see what you are doing?
×
×
  • Create New...