473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

C#-FormApp: COMException Error #80040112.

16
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:
Expand|Select|Wrap|Line Numbers
  1. [Window Title] 
  2. Microsoft Windows 
  3.  
  4. [Main Instruction] 
  5. EQ Client.exe has stopped working 
  6.  
  7. [Content] 
  8. Windows can check online for a solution to the problem. 
  9.  
  10. [V] View problem details  [Check online for a solution and close the program] [Close the program] [Debug the program]
  11.  
Expand|Select|Wrap|Line Numbers
  1. An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in EQ Client.exe 
  2.  
  3. 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.
  4.  
  5. EQ Client.exe!Multiple_Winsock.Program.Main() Line 15 + 0x13 bytes
  6. C#  
  7. EQ Client.exe!Multiple_Winsock.frmConnect.frmConnect() Line 29 + 0xa bytes
  8. C#  
  9.  
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.
Sep 18 '08 #1
19 9761
Kapps
16
Also, if at all possible, I would like to avoid using the Publish part of .NET, and remove the need for an installer.
Sep 19 '08 #2
Plater
7,872 Expert 4TB
Well you are using some third party DLL, that winsock.dll.
Which not everyone has maybe?
Sep 22 '08 #3
Kapps
16
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.
Sep 22 '08 #4
Plater
7,872 Expert 4TB
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
Sep 23 '08 #5
Kapps
16
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.MSWinsockLib.dll. The project references MSWinsockLib, which if I look at the Path of this reference, is set to my project folder + Interop.MSWinsockLib.dll.

Am I just going about this the wrong way, or doing something horribly wrong?
Sep 23 '08 #6
Plater
7,872 Expert 4TB
Hmm I think you need to not have the path to your project folder in how the DLL is referenced?
Sep 24 '08 #7
Kapps
16
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\System32\MSWINSCK.ocx. 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_ROOT\CLSID\{248dd896-bb45-11cf-9abc-0080c7e7b78d}\Implemented Categories\{0DE86A52-2BAA-11CF-A229-00AA003D7352}' was not imported. Client
Sep 25 '08 #8
Plater
7,872 Expert 4TB
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)
Sep 25 '08 #9
Kapps
16
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.
Sep 26 '08 #10
Plater
7,872 Expert 4TB
Maybe the user needs some of the old VBRUNx.DLLs?
Sep 26 '08 #11
Kapps
16
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.
Sep 28 '08 #12
Kapps
16
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: AllowPartiallyTrustedCallers()] onto my main form, but it did not solve this issue.

Any suggestions would be appreciated.
Oct 7 '08 #13
Plater
7,872 Expert 4TB
Maybe you need to get your application into fulltrust for them then?
Oct 7 '08 #14
Kapps
16
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.
Oct 9 '08 #15
Plater
7,872 Expert 4TB
Vista is a lot more picky about security. And the .NET configuration can be found under the "administrative tools" section. Not quite sure how you get your application in there, but it has to be like strongly typed or something like that.
Oct 10 '08 #16
This is not problem of mswinsock registration. its problem of vb6.0 license. if you have a license key then its working. I have small setup to fix this problem.
Jul 2 '09 #17
Frinavale
9,735 Expert Mod 8TB
You know, I'm not sure if this will help but with the the .NET Framework 3.5 there is a Socket class that you should probably be using instead of the MSWinSock.

I've been working a lot with Sockets over the last few days trying to get a COMET solution to work for a web application.

The System.net.Sockets namespace provides us a managed implementation of the Windows Sockets (Winsock) interface....this means that you don't have to bother with the COM problems you're having.
Jul 2 '09 #18
I know about Socket Class and i am using .NET Framework 1.1 already.
But there is problem when using winsock class.

public WinsockClass wskMain = new WinsockClass();
Jul 3 '09 #19
Plater
7,872 Expert 4TB
The Socket class was in there from the .NET1.1 version. You really should avoid using COM objects whenever possible.
Jul 9 '09 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Erwan | last post by:
I have a strange (but very blocking) result when using the smtpmail class from an ASPX page : here is the (very simple !) code... '-------------------------------------------------- mail.To =...
2
by: Diana Estrada | last post by:
Hi, I have a ASP .Net, and in this I load a report or Crystal, with this instruction: crReportDocument.Load(Server.MapPath("") & "reporte.rpt"); It's good, but when I try to load a remote...
0
by: Franck | last post by:
Hi, Working with a Shared Addin (Autodual Class implementing the IdExtensibility2 interface), I'm just makin test in order to fill a range with values but get ComException Error when trying to set...
8
by: Philip Colmer | last post by:
I'm rewriting some existing VBScript into VB.Net code. It was all going well until I hit the following error when testing the code: System.Runtime.InteropServices.COMException (0x80041003) at...
1
by: Philip Colmer | last post by:
I'm rewriting some existing VBScript into VB.Net code. It was all going well until I hit the following error when testing the code: System.Runtime.InteropServices.COMException (0x80041003) at...
6
by: Tomas | last post by:
I'm trying in ASP.NET web page load user accounts from active directory. When I'm developing on local web server it works. I'm using authentication mode=windows and identity impersonate=true...
0
by: holysmokes99 | last post by:
I have a VB.Net (1.1) that uses SQL-DMO via COM Interop to create a linked server. The code throws an exception, as it should, when the linked server I am trying to create already exists on the...
11
by: Don | last post by:
When using Visual Basic .NET with a reference to Interop.Outlook, is there a way to get more detailed information about an error other than Exception.Message or Exception.ToString? For example,...
0
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi, I'm using a control called "TX Text Control Activex Server" load and display word documents and export them as pdf, rtf ...etc and this is the code that should load a word document the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.