Problem loading a windows form. Please help.

W

William Gower

I have created a .net windows form in vb.net and compiled it as a .dll. I
then register the .dll with regasm. I then call the form in a vb 6
application using the following code.

dim c as object
set c = createobject("LaborOrg.form1")
c.show

It works great on my developer machine. I place the .dll and the .tlb on
the client's server and regasm the dll. I check the registry and it shows
LaborOrg.form1. When I click the button to display the form nothing
happens. The app and the winform dll are both on the server and I am trying
to run it from the server. I do have .net framework on the server. Any
suggestions?
 
C

Christopher Kimbell

When running code from a server, you are accessing the code from a different
"zone" in security terms. You probably have to configure security settings
in order to allow code execution.

Chris
 
W

William Gower

Where do I do that?

Christopher Kimbell said:
When running code from a server, you are accessing the code from a different
"zone" in security terms. You probably have to configure security settings
in order to allow code execution.

Chris
 
C

Christopher Kimbell

I'm not quite sure, I've never done it myself.

I had a look at my machine, in the .NET configuration program located in
Control Panel, you can set up security related things.

Under the "Runtime Security Policy" node, you can edit code groups and
permission sets.
I think the clue is to create a permission set with the required
permissions, then assign it to a code group.

How you would distribute these security settings I am unsure of, you
probably have to talk to your network administrator.

I believe the Zone administration is done using the Internet Options
accessible from Internet Explorer.


Another option could be use the Assert() method of the required permission.
The MSDN has the following to say about Assert():
"Declares that the calling code can access the resource protected by a
permission demand through the code that calls this method, even if callers
higher in the stack have not been granted permission to access the resource.
Using Assert can create security vulnerabilities."


Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top