VB.NET usercontrol DLL in Website can't get local Data from SMS - TechRepublic
Question
January 24, 2008 at 12:54 AM
osterman

VB.NET usercontrol DLL in Website can’t get local Data from SMS

by osterman . Updated 18 years, 5 months ago

Dear Coding-Guru

I’m pretty new to the VB.NET thingy and hope someone is guru-enough to help me with that:

I’m working on a Usercontrol in the Visual Studio 2005 .NET 2 on a VISTA32

I builded a USERCONTROL.DLL with the guidance of this tutorial:

Link

The DLL catches DATA from the System of the User. I defined an IIS-Webserver on which Scripting is allowed.

When I debug my Control “local” everything works just fine. The generated HTML Code is made up as it should be and the catching of the system data works fine also.

When I call the HTML File I can’t read the System Data anymore and the main part of the generated HTML Site is empty. The Communication between the DLL and the HTML File works great. Functioncalls / property -Get/sets work fine.

Here is how I embed the dll in the HTML file (at the end).



Here is where I call the function of the control to get the HTML-Data (in the javascriptpart in the head of the HTMLfile)

function getTable()

{

document.getElementById(‘content’).innerHTML = myControl.initData();
}

Here is the control: the Functions that starts the build up of the HTMLCode:

Public Function initData() As String
Implements AxMyControl.initData

Dim aLineIsExpanded As Object

activeColumn = “-3”
activeNewStatus = 2
activeDisplayStatus = 25
activeSearchString = “”
expandedLine = “none”
aLineIsExpanded = False
displayInstalled = True

loadData() ‘get available installations

rowType = CShort(“1”) ‘Setting first tableline style to “dark”

Return getHTML().ToString()

End Function

Public Function getHTML() As String
Implements AxMyControl.getHTML
Dim give As String
give = “Thats rocknroll!!” + buildTable()
userText = give
Return give
End Function

Public Function loadData() As String

On Error Resume Next

‘Declarations
‘Getting Programs
Dim oUiResource As UIResourceMgr
oUiResource = New UIResourceMgr

Dim oPrograms As Programs
oPrograms = oUiResource.GetAvailableScripts()
‘Applications and Scripts = same
Dim oProgram As ProgramCls

‘Creating Array for programs
Dim pCount As Short
pCount = CShort(oPrograms.Count)
ReDim appsArray(pCount)

Dim categories() As String
Dim vCategories() As String
Dim vCategory As String
….


The Function loadData() catches all available Installation-Objects on the Machine by using the Function getAvailableApplications() of the UIResourceMgr Object. It packs all the Information into an array that is used in the function buildHTML() to build up the HTML-of the Website.

When I debug in the VS2005, the array is filled perfectly and the function initData() returns the right HTML Code.

When I test it on the local IIS 7 Webserver, the array stays untouched and the generic part of the website isn’t generated.

On the “Webserver” are all needed DLL Files for the SMSPackaging and the UIResource Manager.

Can anyone please tell me how to debug the DLL when I run the HTML file on my localhost?

Does anybody have an idea why the UIResourceMgr calls of getAvailableApplications don’t work when the dll File is called in the internet explorer?

Please Gurus help me.
Thanks a lot to everybody.
I need your help
Steffen

This discussion is locked

All Comments