C#-FormApp: COMException Error #80040112.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kapps
    New Member
    • Aug 2008
    • 16

    C#-FormApp: COMException Error #80040112.

    Hi,

    I'm having a problem with my program not being able to run on certain computers. They have the basics, such as the .Net Frameworks. Upon trying to run the program, it gives the error:
    Code:
    [Window Title] 
    Microsoft Windows 
     
    [Main Instruction] 
    EQ Client.exe has stopped working 
     
    [Content] 
    Windows can check online for a solution to the problem. 
     
    [V] View problem details  [Check online for a solution and close the program] [Close the program] [Debug the program]
    Code:
    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in EQ Client.exe 
     
    Additional information: Creating an instance of the COM component with CLSID {248DD896-BB45-11CF-9ABC-0080C7E7B78D} from the IClassFactory failed due to the following error: 80040112.
     
    EQ Client.exe!Multiple_Winsock.Program.Main() Line 15 + 0x13 bytes
    C#  
    EQ Client.exe!Multiple_Winsock.frmConnect.frmConnect() Line 29 + 0xa bytes
    C#
    Line 15 of the Client runs the starting form, which is frmConnect. Line 29 on that form creates a new instance of a Winsock.
    public WinsockClass wskMain = new WinsockClass();

    The program works perfectly fine on my computer, but not on his, as well as a few others. Out of four people, only me and one other person can run it. It seems to be a problem with the Winsock. I do realize now that I shouldn't be using Winsock, but this was my first attempt at any sort of not-completely-basic project in C#, and is probably too late to manageably change at this point to Sockets instead.

    You would assume that the problem is something such as they don't have the reference file, or something else like that. But this program worked perfectly fine before, they had no problem in testing it, and it had the Winsock reference (and used it) at the time. I could be wrong, but I believe it broke about the time when I converted it from version 3.5 of .net Frameworks, to version 2.0. I've tried both since then, and neither work. I've also tried using AxMSWinsockLib rather than MSWinsockLib, but that did not work either. I tried setting Isolated to True, and setting Copy Local to True for the reference in my project (as well as setting every other reference in my project to Copy Local = True for the test), and this did not work either.

    I tried including the MSWINSCK.ocx file with my project, had him move it into System32 and register it properly, but this did not seem to change anything. I tried removing the reference to the Winsock library, changing back to 3.5 Frameworks, and readding it, but nothing was successful.

    I am using Windows XP SP2, one of my testers is using Windows Vista, and two others are using Windows XP SP3 (one can run it, one can not).

    Any help would be much appreciated.
  • Kapps
    New Member
    • Aug 2008
    • 16

    #2
    Also, if at all possible, I would like to avoid using the Publish part of .NET, and remove the need for an installer.

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      Well you are using some third party DLL, that winsock.dll.
      Which not everyone has maybe?

      Comment

      • Kapps
        New Member
        • Aug 2008
        • 16

        #4
        Yes, that is part of what the problem is. But I did include the MSWINSCK.ocx as part of my project, which should be what is needed for the Winsock DLL. I also have the DLL set to Copy Local, and it is included with the project. I also tried having the person manually register the DLL, but none of these worked however.

        Thanks for your help though.

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          The OCX is NOT the .DLL.
          You shouldn't even need the OCX for anything, that was just the UI elements for developing in older versions of VB

          Comment

          • Kapps
            New Member
            • Aug 2008
            • 16

            #6
            Well, the .DLL file itself is included with my project, as it is set to Copy Local. Is there something else that I need to do with this?
            In my project is included Interop.MSWinso ckLib.dll. The project references MSWinsockLib, which if I look at the Path of this reference, is set to my project folder + Interop.MSWinso ckLib.dll.

            Am I just going about this the wrong way, or doing something horribly wrong?

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              Hmm I think you need to not have the path to your project folder in how the DLL is referenced?

              Comment

              • Kapps
                New Member
                • Aug 2008
                • 16

                #8
                I'm unable to change this as far as I know. For my reference to it, I just goto Add Reference, COM, Microsoft WinSock Control. If I look at the path, it says C:\Windows\Syst em32\MSWINSCK.o cx. After it's added, the path in my References shows the one referenced from my projects folder.

                Also, when I try setting Isolated to true, I get 6 warnings like:
                Warning 2 Problem isolating COM reference 'MSWinsockLib': Registry key 'HKEY_CLASSES_R OOT\CLSID\{248d d896-bb45-11cf-9abc-0080c7e7b78d}\I mplemented Categories\{0DE 86A52-2BAA-11CF-A229-00AA003D7352}' was not imported. Client

                Comment

                • Plater
                  Recognized Expert Expert
                  • Apr 2007
                  • 7872

                  #9
                  Well, I guess my next question is, why are you using winsock.dll at all?
                  .NET has huge advances in Socket usage and wrapping in comparison. (Access to Sockets at the rough level of c++, plus wrapped classes for ease of use)

                  Comment

                  • Kapps
                    New Member
                    • Aug 2008
                    • 16

                    #10
                    When I was starting this project, I didn't really intend for it to escalate into anything. I never made anything networked in C# (having only used VB6 previously), and nor did I ever make anything even remotely complicated in C#. The idea was just a simple little multiple user chat room, and I didn't understand Sockets at all (I still don't understand anything such as delegates/Asynchronous events/callbacks, as I didn't research them yet since I ended up using Winsock), and just decided to use Winsock at first. I didn't intend for it to actually develop into anything, but it ended up becoming the base for networking for my little game.

                    Now it just feels too late to change, since I already have 5000+ lines of code. There are certainly things that I can do more efficiently/better, and things besides just Winsock that I'd like to change (using OpenGL instead of GDI+ as GDI+ just seems to have too much limits as to what I can do without it eventually starting to get choppy), but I'm still learning and would certainly like to avoid starting over if possible. I'm not entirely sure how much I would have to change to integrate Sockets instead of Winsock as well. This is the only problem I've had so far with Winsock that I couldn't make a solution to, and even this must have some solution that I could hopefully figure out/fix.

                    Comment

                    • Plater
                      Recognized Expert Expert
                      • Apr 2007
                      • 7872

                      #11
                      Maybe the user needs some of the old VBRUNx.DLLs?

                      Comment

                      • Kapps
                        New Member
                        • Aug 2008
                        • 16

                        #12
                        That's possible, but extremely unlikely. One of the users who was previously able to run my game (1 can, 1 never could, 1 could and now can't) no longer can not, and he didn't make any changes such as uninstalling VB.

                        Comment

                        • Kapps
                          New Member
                          • Aug 2008
                          • 16

                          #13
                          One thing which was occurring before is something that said MSWinsockLib is an interop which requires full trust in a warning. I got rid of this by adding [assembly: AllowPartiallyT rustedCallers()] onto my main form, but it did not solve this issue.

                          Any suggestions would be appreciated.

                          Comment

                          • Plater
                            Recognized Expert Expert
                            • Apr 2007
                            • 7872

                            #14
                            Maybe you need to get your application into fulltrust for them then?

                            Comment

                            • Kapps
                              New Member
                              • Aug 2008
                              • 16

                              #15
                              I'm not sure how I would go about doing that.
                              The person on Vista tried running as Administrator, and the person on XP also has administrative privileges. The one who could run it did nothing special, and was also running it on XP.

                              Comment

                              Working...