Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing Mailbee.dll COM component for executable
#1
Hi Gintaras,
I am trying to use the QM email functions in an executable. I see in the QM help that:

Quote:QM email functions use COM component mailbee.dll. If you use it in exe on computers where QM is not installed, you must install mailbee.dll there. Take it from QM folder. Read more. If you use functions from Services type library, install arservicesmgr.dll.

I have placed the mailbee.dll in the same folder as the executable but have not tested whether this will be enough (e.g. the same way that is enough for sqlite functions to work if sqlite3.dll is in the same folder. I see that there might be more to it in the "Distributing macros that use COM components" section in the QM help.

I will be able to test on a computer soon that has never had QM installed on it before but if there is some types of declerations or other COM registration steps necessary, if you could give an example that could be enormously helpful.
Thanks!,
S
#2
Need to register as COM component.
QM function RegisterComComponent does it. Need admin.
#3
Thanks so much, Gintaras, for your rapid reply.
So if I understand this correctly, all I need to do is add the following line to my install script:

Code:
Copy      Help
str MailBeeDll_LocalPath = "[WHEREVER MY EXE FILE IS LOCATED]"
RegisterComComponent MailBeeDll_LocalPath 4

and then have admin rights at time of install.
I don't think I will have to declare a type library (as described below), if I use the SendMail function in the exe. Is that correct?

Quote:To use a component, its type library must be declared. The declaration statement can be in the same macro, or in other macro, e.g., in init2 function or some other function that runs at startup (has "QM file loaded" trigger). Several type libraries are already declared by QM, and you can see them at the bottom of the list when you type a period.


Thanks so much,
S
#4
str MailBeeDll_LocalPath = "[WHEREVER MY EXE FILE IS LOCATED]\mailbee.dll"
RegisterComComponent MailBeeDll_LocalPath 4

Don't need typelib.
#5
Look somewhere in Resources, it's possible to use COM components without registration.
#6
This is great...I found the info at:
Using COM components without registering
http://www.quickmacros.com/forum/showthr...p?tid=3693

First I am trying it in the QM folder before trying it in my exe locations. I made the manifest and put in the QM folder and now am running this in the function where the email is.


Code:
Copy      Help
#compile "____UseComUnregistered"
__UseComUnregistered x.Activate("mailbee.X.manifest")

typelib Lib "$qm$\mailbee.dll";;
Lib.Class c._create


When I try this, I get the error:

Quote:Error in Macro9: unknown identifier.
which points to Class in Lib.Class line
of note, Lib has already turned grey suggesting that it has been recognized as a typelib by the previous line.
Maybe I am getting the error because, Mailbee is already recognized as a type in QM and so this typelib step is unnecessary and will also be unneccesasry in exe.

Any thoughts? Thanks again,
S
#7
Don't need typelib for mailbee. The MailBee typelib is declared in System.
#8
Thanks, I figured that would be the case. I assume this will also be true for executable?
Stuart
#9
Tested with mailbee. Created function to make easier. Probably all this will be in next QM.
http://{deleted post}
#10
You are the best Gintaras!!! Big Grin
Thanks so much!!!
Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)