Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VB6 OCX control in asp.net problem - errors occur

Status
Not open for further replies.

rajeshkumar123

Full Member level 3
Joined
Dec 27, 2007
Messages
168
Helped
23
Reputation
46
Reaction score
4
Trophy points
1,298
Location
Chennai-India
Activity points
2,124
.net help

We are developing a web application in .NET.I need to use VB6 OCX control in asp.net.
I add reference to the OCX control in my .net application

In my vb coding (default.aspx.vb), i add the following code to create object for the OCX Control,

Imports IPM50_OCX
Dim WithEvents objGPRSControl As IPM50_OCX.GPRSControl

Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
objGPRSControl.LocalPort = 1001 I got the error in this line “Object reference not set to an instance of an object.”
objGPRSControl.GPRSMode = 2
end sub

So I add ‘New’ keyword in OCX object creation step

Dim WithEvents objGPRSControl as new IPM50_OCX.GPRSControl

After I use the ‘New’ keyword, I got this error. I try to change the scope of the declaration, but it’s not resolve.

Error 99 'IPM50_OCX.GPRSControlClass.Private Sub New ()' is not accessible in this context because it is 'Private'.


I search the internet getting solution to this problem.after I follow these steps
Register the IPM50_OCX file in the global assembly cache (GAC).
gacutil /i E:\Ganga\Projects\IPM50-GPRS\Bin\Interop.IPM50_OCX.dll

After run this, I got

Failure adding assembly to the cache: Attempt to install an assembly without a strong name

I create Key for IPM50_OCX.
Sn.exe –k Interop.IPM50_OCX.keys

I gives the public key 1231ec482047e661

<Assembly: AssemblyKeyFileAttribute("C:\Program Files\Microsoft Visual Studio 8\VC\Interop.IPM50_OCX.dll")>


Error 99 Unable to emit assembly: Referenced assembly 'Interop.IPM50_OCX' does not have a strong name

Can anyone help me in this regard?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top