Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. 'Type' to 'Structure' help

'Type' to 'Structure' help

Scheduled Pinned Locked Moved Visual Basic
helpcsharpvisual-studiosysadminquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DaveC426913
    wrote on last edited by
    #1

    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)

    D 1 Reply Last reply
    0
    • D DaveC426913

      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)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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 use Type.GetTypeFromProgId on a COM server, like "Scripting.FileSystemObject", it will always return a type of System.__ComObject. What are you trying to do with this? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      D 1 Reply Last reply
      0
      • D Dave Kreskowiak

        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 use Type.GetTypeFromProgId on a COM server, like "Scripting.FileSystemObject", it will always return a type of System.__ComObject. What are you trying to do with this? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        D Offline
        D Offline
        DaveC426913
        wrote on last edited by
        #3

        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)

        D 1 Reply Last reply
        0
        • D DaveC426913

          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)

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          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

          D 1 Reply Last reply
          0
          • D Dave Kreskowiak

            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

            D Offline
            D Offline
            DaveC426913
            wrote on last edited by
            #5

            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)

            D 1 Reply Last reply
            0
            • D DaveC426913

              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)

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups