Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

Is there any alternative for using MSWINSCK.OCX in WPF, as we can't directly use MSWINSCK.OCX in WPF, we have created Winform control using MSWINSCK.OCX and then used same in WPF project. Its worked on our development platform but while deploying it on client's environment its giving me error as :

System.ComponentModel.LicenseException: You must have a license to use this ActiveX control.
at System.Windows.Forms.AxHost.CreateInstance()


Thanks in advance,

Kunal
Posted

Or you could just drop the OCX entirely and rewrite using the built in Socket classes in the System.Net namespace in the .NET Framework.
 
Share this answer
 
Comments
Mike Meinz 19-Feb-13 11:10am    
Excellent suggestion!
Kunal_Daud 26-Feb-13 6:45am    
Thanks for Suggestion, I have created my own component using System.Net.Socket
:)

Regards

Kunal Daud
Maybe this will help:
OstroSoft Winsock Component[^]
Download oswinsck.exe (The version that works with .NET).

OstroSoft Winsock Component

Licensing
Can be used in any version of Visual Basic and in any language, supporting COM

Distribution
Requires only oswinsck.dll and VB runtimes

Usage
Doesn't require visual interface, can be used in class modules

Scripting
Provides blocking calls for scripting
 
Share this answer
 
Comments
Kunal_Daud 20-Feb-13 1:52am    
Thanks for OSWINSCK.exe.

But unfortunately data arrived from OSWINSK.dll (0109040910) and MSWINSK.OCX (0904091001018) does not match with each other so we cant use this component.

Any suggestion?
Mike Meinz 20-Feb-13 7:25am    
Two suggestions
1. Develop your own component using System.Net.Sockets which is part of .NET Framework.
2. Figure out why OSWINSCK.DLL is yielding different results. It's always worked correctly for me. It may be timing if data is arriving in small packets, OSWINSCK.DLL delivers what it has got when you make the call to get data just like any sockets-based software. Without looking at your code and fully understanding your application's data flow, it is difficult to tell what is wrong.
Kunal_Daud 26-Feb-13 6:46am    
Thanks for Suggestion, I have created my own component using System.Net.Socket
:)

Regards

Kunal Daud
I have created my own component using System.Net.Socket
:)

Regards

Kunal Daud
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900