Join 137,208 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,290 people online right now. Registration is fast and FREE... Join Now!
Aright guys I found a 400 page ebook that teaches you how to make your very own RPG in vb6 using directx8 it told me to get sp6 for vb6 and to get the directx8SDK I have both of them installed but when I run the program to load an image on the screen I get a local error and it displays "Critical error in LoadSurface!" there is no way of debugging this because if I take the error handler away vb just crashes instantly.
Here is the code for the LoadSurface Function
CODE
Private Function LoadSurface( _ ByVal filename As String, _ ByVal width As Long, _ ByVal height As Long) _ As Direct3DSurface8 On Local Error GoTo fatal_error Dim surf As Direct3DSurface8 'return error by default Set LoadSurface = Nothing 'create the new surface Set surf = d3ddev.CreateImageSurface(width, height, dispmode.Format) If surf Is Nothing Then MsgBox ("Error creating surface!") Exit Function End If fatal_error: MsgBox ("Critical error in LoadSurface!") Shutdown End Function
Since you have your own error message in theire we have no way of knowing what the real error message is, thus making it impossible for us to determine a fix. To get the true error message change your fatal_error block to this
I found it on scribd. I don't know if this is my main problem I didn't want to say anything because people might just jump the gun like I do. A long time ago maybe a year I wanted to play gears of war on my pc and it said I needed a newer graphics driver for my card but my card was at its last version since its old ati only lets a certain card get to a certain version my graphics card it sposto run at 6.4 version but I did some haxin on my card and I managed to get 8.4 on it my display went all wonky and i had weeks of problems when i plug my graphics card into a pc now it automatically loads up 8.4 drivers i have no clue what i did but now i cant play most games and i get alot of directX errors not only in programing but playing games. I have no clue of how to get 6.4 on my graphics card its not as simple as installing the drivers...
so what im thinking is that I did this to my card and now I broke alot of stuff and i get thease funky errors like the one we have here when installing carbon {I have played it on my pc with this graphics card} I get this funky error telling me I need directx0 or better and it dosent even install.
This indeed sounds like a hardware issue. It sounds as if your card no longer likes DirectX. When you said an error of zero was returned that let me know that this isn't an error with the code, it truly sounds like an issue with your card.
you wouldn't happen to know a way of fixing my card or know someone who could help me fix my card would you?
And would you mind helping me with a previous topic I made yesterday ill give a link here its not a project its just a side thing I want to do I would appreciate it if you could help me on that.... thank you for the help
I thought I would like to point out that it isn't his hardware, but infact is his code
CODE
Private Function LoadSurface( _ ByVal filename As String, _ ByVal width As Long, _ ByVal height As Long) _ As Direct3DSurface8 On Local Error GoTo fatal_error Dim surf As Direct3DSurface8 'return error by default Set LoadSurface = Nothing 'create the new surface Set surf = d3ddev.CreateImageSurface(width, height, dispmode.Format) If surf Is Nothing Then MsgBox ("Error creating surface!") Exit Function End If exit function '---This is what I added, There was nothing to stop the function from executing the code, which results in a Err 0 fatal_error: MsgBox ("Critical error in LoadSurface!") Shutdown End Function