createobject

What is the difference between using cfinvoke and createObject to run a component function?

帅比萌擦擦* 提交于 2019-12-23 09:26:53
问题 In my company's code, I've often seen component files used by initializing an object of that component and calling the methods off the object. However, it seems to me somewhat more straightforward to use the cfinvoke method, especially when only using one method from the component file. What are the differences between these 2 methods of calling a component function and what are the pros/cons of each? When should I use which? 回答1: cfinvoke can only be used in tags. createObject can be used in

Failed to execute 'createObjectURL' on 'URL':

给你一囗甜甜゛ 提交于 2019-12-17 15:34:09
问题 Display Below error in Safari. Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided. My Code is: function createObjectURL(object) { return (window.URL) ? window.URL.createObjectURL(object) : window.webkitURL.createObjectURL(object); } This is my Code for image: function myUploadOnChangeFunction() { if (this.files.length) { for (var i in this.files) { if (this.files.hasOwnProperty(i)) { var src = createObjectURL(this.files[i]); var image = new

What is “Dim fso, MyFile, FileName, TextLine” in VBA?

微笑、不失礼 提交于 2019-12-13 02:34:43
问题 I received this code from one of those nice people here who are willing to spend their time and energy to share their knowledge with noobs: Sub ReadLinesFromAFileOneAfterAnother () Const ForReading = 1, ForWriting = 2, ForAppending = 8 Dim fso, MyFile, FileName, TextLine Set fso = CreateObject("Scripting.FileSystemObject") FileName = "c:\testfile.txt" Set MyFile = fso.OpenTextFile(FileName, ForReading) '' Read from the file Do While MyFile.AtEndOfStream <> True TextLine = MyFile.ReadLine ''

including classes with a wsc file

◇◆丶佛笑我妖孽 提交于 2019-12-11 19:19:58
问题 Ok, what am i doing wrong here? i'm trying to include a vbscript with a class inside this way: SCRIPT.VBS: set inc = createobject("script.runner") inc.Include "class" set x = new test x.msg' here i get the error 'undefined class'! REGISTERED .wsc file: <?xml version="1.0"?> <component> <registration description="wsc" progid="script.runner" version="1.00" classid="{f65e154c-43b3-4f8f-aa3d-535af68f51d1}" > </registration> <public> <method name="Include"> <PARAMETER name="Script"/> </method> <

How to consume COM object in ASP.NET class file

心不动则不痛 提交于 2019-12-11 06:46:21
问题 I have a COM object that I am trying to wrap in a C# class in order to make it more readily available for other applications that wish to consume it. I have the following code that creates an instance of the COM object, and then using reflection makes a call to a method to retrieve user data. This code works fine when it is located in an aspx page. object jdObj = Server.CreateObject("jd_api.UserCookie"); string username = jdObj.GetType().InvokeMember("GetUserName", System.Reflection

How to determine the association between a VB6 app and an exe instanced with CreateObject()

亡梦爱人 提交于 2019-12-11 03:23:49
问题 We need to figure out how a service can peek at a running VB6 app and/or its DCOM spawned exe and figure out which VB6 app goes with which DCOM exe. The VB6 app and the spawned exe are both on the same server. We have a VB6 app that spawns an instance of Bartender (from Seagull Scientific) by way of a CreateObject() call. On a given server, we may have ten or twenty instances of our app, each represents a handheld RF gun client in a warehouse. 95% or more of these VB6 apps will have their own

Discovering registered COM components

99封情书 提交于 2019-12-10 11:33:50
问题 Is there a way to determine if a registered COM component is creatable as a stand-alone component simply by parsing the information available in the registry? In particular, by the information found in HKCR/ClsId? My system has over 12,000 entries in this key, and I am already excluding any items that do not have an InProcServer32 or LocalServer32 key, but this only eliminates about half of the items. I believe there are still another couple thousand that are not creatable objects. I really

Classic ASP using C# .net DLL Object doesn't support this property or method

旧城冷巷雨未停 提交于 2019-12-10 11:09:15
问题 Hey all this is my first time creating a COM object for a classic asp page. The process I followed when creating this COM DLL is this: 1) Used the Strong Name Tool (sn.exe) and placed the .snk file within the app. (sn -k myKey.snk) 2) Added: [assembly: AssemblyKeyFile(@"myKey.snk")] [assembly: ComVisible(true)] to the AssemblyInfo.cs. I do get a warning on the KeyFile saying: Use command line option '/keyfile' or appropriate project settings instead of 'AssemblyKeyFile' 3) Ran the following

Create an object from another objects type

有些话、适合烂在心里 提交于 2019-12-10 10:04:05
问题 In Visual Basic.net, can I create an Object, or a List of T with the type from another object. Here is some code: Dim TestObjectType As Author Dim TestObject As TestObjectType.GetType I am getting an error: TestObjectType.GetType is not defined EDIT Can I create a Type object of a certain type, and then create objects, lists or cast objects to this type from this Type object? 回答1: Dim TestObject As TestObjectType.GetType will look for a type named GetType in the namespace TestObjectType . To

Question about CreateObject() in VB6 / VBA

[亡魂溺海] 提交于 2019-12-08 15:04:29
问题 I can do this: Dim fso As New FileSystemObject or I can do this: Dim fso As Object Set fso = CreateObject("Scripting.FileSystemObject") How do I know what string to use for CreateObject? For example, how would I know to use the "Scripting." part of "Scripting.FileSystemObject"? Where do you go to look that up? 回答1: It is the ProgID of the component which is registered in Windows registry under HKCR key: HKEY_CLASSES_ROOT\Scripting.FileSystemObject ProgID's are human readable identifiers for