Jump to content
Xtreme .Net Talk

Squirm

Leaders
  • Posts

    186
  • Joined

  • Last visited

Everything posted by Squirm

  1. Visual C++.Net is just Microsoft's newest C++ compiler. Sure, there is MFC and now Managed Extensions, but you are not forced to use either. There's really no such thing as learning VC++. What you probably mean is learning to use the MFC library. Yes it is possible to make 3D games with VC++(.Net), I would even advise it, if you stay away from MFC and Managed Extensions. C++ is the language of choice for the game developer, with a sprinkling of inline ASM for those speed-critical functions. You can use DirectX 8 or 9, or even OpenGL if you fancy a different programming style.
  2. Change End to Me.Close(). I don't know if they made End any better in VB.NET than it was in VB6, but I can tell you that in earlier versions of VB End should never be used. For this reason alone I personally would advise against using it in .NET. There are many better ways of terminating an application I am sure.
  3. No, API is still alive and kicking: http://www.elitevb.com/content/01,0075,01/ Although there are now many API functions wrapped by the framework. As for winsock, you'd now use the System.Net.Sockets namespace.
  4. Resource files are included in the exe, DLL files are not. However, you only need to package DLLs which are not part of the framework.
  5. I had this problem too. The SDK install did not infact install the DirectX DLLs. I had to manually copy and paste them from the .CAB files to the proper locations within the Microsoft .Net directory. Then (this may have been because I didnt realise there was a new project type) I added references to the DLLs from within the project.
  6. Squirm

    Path problem

    Using a Win32 API function: http://www.mentalis.org/apilist/GetShortPathName.shtml
  7. 'To highlight text: TextBox1.SelectionStart = 0 TextBox1.SelectionLength = Len(TextBox1.Text) 'To just copy the whole text: Clipboard.SetDataObject(TextBox1.Text)
  8. I see what you want to do, but its really not very simple. HSL and RGB are two very different systems. HSL is easier for users and RGB is more suited to programs. It isnt too hard to convert from HSL to RGB but converting the other way is more complex. If you just want to alter the luminosity of a color, you need to get the individual RGB components and multiply them with a scaling factor, as I have done in that final section of my code.
  9. Inside the If Then...End If blocks, place your happy/sad/angry generating code. If RadioButton1.Checked Then 'Generate happy ElseIf RadioButton2.Checked Then 'Generate sad ElseIf RadioButton3.Checked Then 'Generate angry End If
  10. There is no better solution than moving your DLL to the application directory (or the System directory, but you probably don't want that either). Standard DLLs are not referenced in any way, they are located purely on filename.
  11. Move your code into a procedure which handles the Click event for the button. The only changes which need to be made would be some code to determine which optionbutton is selected.
  12. Use itoa to convert from an int to a string buffer. The function takes a parameter which specifies which base to represent the number in. Pass it 16 for hexadecimal.
  13. I just use m and not bother with an underscore.
  14. Here is a function I cooked up which creates a Color from HSL values in the range 0-239. It seems to work exactly as the one in the choose colour dialog does: Private Function ColorHSL(ByVal hue As Integer, ByVal sat As Integer, ByVal lum As Integer) As Color Dim r, g, b As Double Dim dblhue, dbllum, dblsat As Double Dim temp As Double hue = hue Mod 240 sat = sat Mod 240 lum = lum Mod 240 dblhue = Convert.ToDouble(hue) dblsat = Convert.ToDouble(sat) dbllum = Convert.ToDouble(lum) 'Hue If hue < 80 Or hue > 160 Then If hue > 160 Then temp = 240 - dblhue Else temp = dblhue If (temp > 40) Then temp = temp - 40 Else temp = 0 r = 255 - (temp * 6.375) End If If hue < 160 Then temp = Math.Abs(dblhue - 80) If (temp > 40) Then temp = temp - 40 Else temp = 0 g = 255 - (temp * 6.375) End If If hue > 80 Then temp = Math.Abs(dblhue - 160) If (temp > 40) Then temp = temp - 40 Else temp = 0 b = 255 - (temp * 6.375) End If 'Saturation r = r + ((127 - r) * (dblsat / 240)) g = g + ((127 - g) * (dblsat / 240)) b = b + ((127 - b) * (dblsat / 240)) 'Luminosity If lum > 120 Then r = r + ((255 - r) * ((dbllum - 120) / 120)) g = g + ((255 - g) * ((dbllum - 120) / 120)) b = b + ((255 - b) * ((dbllum - 120) / 120)) ElseIf lum < 120 Then r = r * (dbllum / 120) g = g * (dbllum / 120) b = b * (dbllum / 120) End If Return Color.FromArgb(Convert.ToInt32(r), Convert.ToInt32(g), Convert.ToInt32(b)) End Function Hope that helps.
  15. This forum is for Visual Studio.Net only. For legacy Visual Basic please visit http://www.visualbasicforum.com and post in their Random Thoughts forum. :)
  16. I'm creating a number of pictureboxes dynamically: For i = 0 To 14 pPicture = New PictureBox() cPics.Add(pPicture, CStr(i)) Me.Controls.Add(pPicture) pPicture.Width = 60 pPicture.Height = 60 pPicture.Left = (iPositions(i) Mod 4) * 60 pPicture.Top = (iPositions(i) \ 4) * 60 pPicture.Visible = True pPicture.Image = Image.FromFile("C:\EVBFpuzzle\" & CStr(i) & ".bmp") Next i All is well, the pictureboxes appear as they should. Now comes the part I'm having difficulty with. I want to have a procedure which handles the click event for all of these pictureboxes. Just one procedure. How would I go about achieving this?
  17. DirectX is of use wherever there is a need for advanced graphics techniques, including 3D. I'm sure it is used in testing/simulation, data modelling, and I personally have used Direct3D in graphing. Basically if you need high-speed graphics, or 3D, then you might choose to use DirectX. It is also used for things like screensavers.
  18. Zip up the necessary files, and click the Browse button underneath where you type your posts, select the file and submit. It should then be attached to your post.
×
×
  • Create New...