'Type' to 'Structure' help
-
Agh! My sample code uses 'Type', but VS.NET tells me it is no longer supported - I am to use 'Structure' instead. So I need help converting this from type to structure: Type tServerType = Type.GetTypeFromProgID("WMSServer.Server", ); Help? ________________________________________________________________________ Dave Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
-
Agh! My sample code uses 'Type', but VS.NET tells me it is no longer supported - I am to use 'Structure' instead. So I need help converting this from type to structure: Type tServerType = Type.GetTypeFromProgID("WMSServer.Server", ); Help? ________________________________________________________________________ Dave Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
That's not going to work.
Type.GetTypeFromProgId
will always return a Type, not a structure. There is no way to convert one to a structure either. If you useType.GetTypeFromProgId
on a COM server, like "Scripting.FileSystemObject", it will always return a type ofSystem.__ComObject
. What are you trying to do with this? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -
That's not going to work.
Type.GetTypeFromProgId
will always return a Type, not a structure. There is no way to convert one to a structure either. If you useType.GetTypeFromProgId
on a COM server, like "Scripting.FileSystemObject", it will always return a type ofSystem.__ComObject
. What are you trying to do with this? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming GnomeThe code is copied verbatim from the microsoft site: http://msdn.microsoft.com/library/en-us/wmsrvsdk/htm/creatingaspserverobj.asp?frame=true --- // Create a remote WMSServer object from a System.Type object and // the CreateObject method. Type tServerType = Type.GetTypeFromProgID("WMSServer.Server", "remote_server_name"); WMSServer wms = (WMSSServer)Server.CreateObject(tServerType); // Create a remote WMSServer object from a System.Type object and a // System.Activator object. Type tServerType = Type.GetTypeFromProgID("WMSServer.Server", "remote_server_name"); WMSServer wms = (WMSServer)Activator.CreateInstance(tServerType); --- (I realize this is ASP. I am confounded at the interplay between VB froms and ASP pages and the code on each. Half the samples I want are in ASP and half are in VB, and frankly I don't understand how the two work together in Visual Studio.) In VB, a sample looks like this: --- Imports Microsoft.WindowsMediaServices.Interop Imports System.Runtime.InteropServices Dim tServerType As Type Dim RemoteServer As WMSServer Try tServerType = Type.GetTypeFromProgID("WMSServer.Server", "server_name") ' Create an instance of the remote server object locally. RemoteServer = Activator.CreateInstance(tServerType) --- but, no matter WHAT I try, I get 'access denied'. I have been configuring my systems for 5 days now. ________________________________________________________________________ Dave Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
-
The code is copied verbatim from the microsoft site: http://msdn.microsoft.com/library/en-us/wmsrvsdk/htm/creatingaspserverobj.asp?frame=true --- // Create a remote WMSServer object from a System.Type object and // the CreateObject method. Type tServerType = Type.GetTypeFromProgID("WMSServer.Server", "remote_server_name"); WMSServer wms = (WMSSServer)Server.CreateObject(tServerType); // Create a remote WMSServer object from a System.Type object and a // System.Activator object. Type tServerType = Type.GetTypeFromProgID("WMSServer.Server", "remote_server_name"); WMSServer wms = (WMSServer)Activator.CreateInstance(tServerType); --- (I realize this is ASP. I am confounded at the interplay between VB froms and ASP pages and the code on each. Half the samples I want are in ASP and half are in VB, and frankly I don't understand how the two work together in Visual Studio.) In VB, a sample looks like this: --- Imports Microsoft.WindowsMediaServices.Interop Imports System.Runtime.InteropServices Dim tServerType As Type Dim RemoteServer As WMSServer Try tServerType = Type.GetTypeFromProgID("WMSServer.Server", "server_name") ' Create an instance of the remote server object locally. RemoteServer = Activator.CreateInstance(tServerType) --- but, no matter WHAT I try, I get 'access denied'. I have been configuring my systems for 5 days now. ________________________________________________________________________ Dave Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
Do you have two servers for your app? One is the web server and the other is a media server with Window Media Services installed? Are they arranged in a domain environment or are they workgroup with each having it's own set of user accounts? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Do you have two servers for your app? One is the web server and the other is a media server with Window Media Services installed? Are they arranged in a domain environment or are they workgroup with each having it's own set of user accounts? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Two servers: one web, one media. Different domains. I could set them up in the same domain if you think thast would make things easier. ________________________________________________________________________ Dave Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
-
Two servers: one web, one media. Different domains. I could set them up in the same domain if you think thast would make things easier. ________________________________________________________________________ Dave Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
DaveC426913 wrote: Different domains That's why you're getting "Access Denied". Your web code is running under the ASPNET account on one domain, who's SID does not exist in the other. Your best solution is to get both servers into the same domain. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome