Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using COM components without registering
Macro Using COM components without registering
Copy      Help
;For those that use COM components.

;Normally, to use a COM component on a computer, it must be registered.
;You do it in QM Type Libraries dialog, or call RegisterComComponent, or use regsvr32, or run setup program, etc.
;Usually, registering a component just adds some data in the registry. Dll and type library paths, etc.
;But sometimes there is no way to register. For example, if your program does not have admin privileges.
;Possible to use COM components without registration.

;The first way - side-by-side assemblies. Put component path etc in a manifest file.
;;;;The __UseComUnregistered class uses this way.
;;;;Advantages: It is documented and recommended way. Almost always works.
;;;;Disadvantages: Does not work on Windows 2000 and XP SP0. The component must be in qm folder or a subfolder.

;The second way - use low level COM object creation functions.
;;;;The CreateComObjectUnregistered uses this way.
;;;;Advantages: Works on all Windows versions. Don't need additional files.
;;;;Disadvantages: Works not with all components. Possible various anomalies. Cannot be used with ActiveX controls.
The second way now is in QM 2.3.4, in _create, ActiveX controls and QM email functions.

Also need this function, if your QM version is <
Member function str.FromGUID
Copy      Help
function$ GUID&guid

;Creates GUID string from binary GUID.
;Tip: To create binary from string, use uuidof.


word* w
StringFromIID(&guid &w)
ret this

Fixed bug: on Windows 2000 caller cannot handle error because it is generated inside the function, not in caller.
Added function ExeEnableMailFunctions. Allows using QM email functions on any computer without registering mailbee.dll as a COM component.

Attached Files
.qml   Using COM components without registering.qml (Size: 9.43 KB / Downloads: 571)

Forum Jump:

Users browsing this thread: 1 Guest(s)