Announcement

Collapse
No announcement yet.

Direct Input M$ programming problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Direct Input M$ programming problem

    Can anyone please tell me why when I just cut & paste the code from

    http://msdn.microsoft.com/library/de...ut_vb_4z1e.asp Step 1.

    (correcting the formatting at the end of the first part) that I get a 'compile error: Next without For' on the 'Next i' line?

    Please help! I've tried retyping all sorts of lines, commenting out etc. I'm using Visual Studio 6 SP5 & DX8 on Win2kPro.

    Is this just another m$ 'feature'

    Thanks in advance!

    Tony.

    [Edit correcting URL]
    Last edited by Fat Tone; 1 November 2001, 14:54.
    FT.

  • #2
    I cannot tell for sure... but i did noticed that the in the 4rth gray rectangle there's 1 for and 2 next... the other for command is in the 3rd rectangle.... so make sure u cut and pasted all 4 rectangles... maybe u got rid of this line while reformating.

    For i = 1 To diEnumDev.GetCount

    For the rest... i can't tell i don't code much in VB.

    Spazm
    P3-667@810 retail, Asus CUSL2-C, 2*128 mb PC-133(generic), G400DH 16mb, SBLive value, HollyWood+, 1*Realtek 8029(AS) and 1*Realtek 8039C, Quantum 30g, Pioneer DVD-115f

    Comment


    • #3
      only thing I can think of is to make sure the line:

      If FoundForce Then Exit For

      didn't get messed up along the way.
      Gigabyte GA-K8N Ultra 9, Opteron 170 Denmark 2x2Ghz, 2 GB Corsair XMS, Gigabyte 6600, Gentoo Linux
      Motion Computing M1400 -- Tablet PC, Ubuntu Linux

      "if I said you had a beautiful body would you take your pants off and dance around a bit?" --Zapp Brannigan

      Comment


      • #4
        Solved that one...

        There was an End If missing to close the processing feedback device section. Thanks for the suggestions.

        Now I get run time errors that make me thing I'm doing something completely wrong. Please help a newbie!

        I have created a form, with a button, whose click code is the ForceFeedback stuff.

        Now when I run it, I get to click on the button, but at the line
        Set di = dx.DirectInputCreate
        I get a Runtime error 91: Object variable or With Block variable not set.

        If I replace dx.DirectInputCreate with DirectX8.DirectInputCreate then the error changes to Error 424: Object required (same line).

        The help for this makes me think I have the wrong context or something.

        Can someone please suggest what I'm doing wrong?

        TIA

        Tony.
        Last edited by Fat Tone; 2 November 2001, 05:48.
        FT.

        Comment


        • #5
          Hmm... i can't tell without trying or seing your code.... but since i don't have VB installed right now i'll test microsoft code at school this morning while i won't have anything to do... which happend often. After i'll have tested that i might have a better idea but i've already ran in that problem... just don't remember how i got rid of it.

          Spazm
          P3-667@810 retail, Asus CUSL2-C, 2*128 mb PC-133(generic), G400DH 16mb, SBLive value, HollyWood+, 1*Realtek 8029(AS) and 1*Realtek 8039C, Quantum 30g, Pioneer DVD-115f

          Comment


          • #6
            Thanx - looking forward to your reply
            FT.

            Comment


            • #7
              Well i'll be damn. My school still has the dx that comes with NT4 (to what i saw it would be dx3)... i'd have to install it (no prob since i'm admin) but... i guess the tech would'nt be too happy about it. I'll install VB on my pc tonight and check that in details. Meanwhile TNT might had gave u the answer.

              Spazm
              Last edited by spazm_1999; 2 November 2001, 07:09.
              P3-667@810 retail, Asus CUSL2-C, 2*128 mb PC-133(generic), G400DH 16mb, SBLive value, HollyWood+, 1*Realtek 8029(AS) and 1*Realtek 8039C, Quantum 30g, Pioneer DVD-115f

              Comment


              • #8
                I found the solution to your problem.... can u email me. I'll mail u the solution + a little app that works using the corrected code.

                Spazm
                P3-667@810 retail, Asus CUSL2-C, 2*128 mb PC-133(generic), G400DH 16mb, SBLive value, HollyWood+, 1*Realtek 8029(AS) and 1*Realtek 8039C, Quantum 30g, Pioneer DVD-115f

                Comment

                Working...
                X