Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generate COM Component from C#
#3
Thanks for your help.
It seems that I also need to define the interface again in QM.
With the following code, the member functions can be displayed using the dot notation. However, I want to be able to call the function using "mc.Add" in any QM macro. Is there anything else I need to do to achieve this?

Function Com_Demo_T2
Code:
Copy      Help
interface# IMyComClass :IDispatch
,#Add(a b)
,{12345678-1234-4321-ABCD-1234567890AB}
CsScript x.Load("$qm$\MyCom.dll")
IMyComClass mc=x.CreateObject("ComDemo.MyComClass")


out mc.Add(7,8)

My ultimate goal is to be able to use the loaded class and its functions in any QM macro or function, and for it to continue working even after generating an EXE. Is this possible?

The reason for this idea is that I have too many C# code functions. If I add each function as a separate DLL resource, I have to load each DLL file separately for every function call, and then invoke it, which results in high resource overhead. Therefore, I want to generate all these C# functions into a single DLL, and then execute them using the method mentioned above. This would be much more convenient.


Messages In This Thread
Generate COM Component from C# - by Davider - 06-18-2025, 09:09 AM
RE: Generate COM Component from C# - by Gintaras - 06-18-2025, 09:43 AM
RE: Generate COM Component from C# - by Davider - 06-18-2025, 10:24 AM
RE: Generate COM Component from C# - by Gintaras - 06-18-2025, 11:19 AM
RE: Generate COM Component from C# - by Davider - 06-18-2025, 01:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)