There seems to be a problem with both oDB2D.RGBC and oDB2D.ColorAmbientLight. I have amended my code as follows:
Public Sub GetAmbientLight()
Dim B As Integer
Dim C As String
Dim Couleur As System.Drawing.Color
Dim G As Integer
Dim R As Integer
Dim St As String
Try
St = LightA
C = Token(St)
oDBLight.SetAmbientLight(C)
C = Token(St)
R = CInt(C)
C = Token(St)
G = CInt(C)
B = CInt(St)
Couleur = System.Drawing.Color.FromArgb(R, G, B)
oDBLight.ColorAmbientLight(Couleur.ToArgb())
Catch ex As Exception
MsgBox(IDCS_013, IDC_CRITICAL, IDC_VERSION)
End Try
End Sub
LightA is a string that holds "70 255 255 255".
So, reaching the sub's end, R, G and B hold 255 each (I've checked and re-checked). Then oDBLight.ColorAmbientLight throws an exception. If I say "Couleur = oDB2D.RGBC(R, G, B)", oDB2D.RGBC throws an exception.
At this point, I'm lost. With VB Express, "Integer" is 32 bits.
ex.Message is "Arithmetic operation resulted in an overflow."
Couleur.ToArgb() is -1.
What I'm trying to do is to implement this simple dialog box in a 3D application. And worse is to come: I intend to create a directional light as well!
Thierry