Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSMAPI license error at runtime 1

Status
Not open for further replies.

MarvinR

Programmer
Oct 29, 2001
37
0
0
HK

loSession = CREATEOBJECT("MSMapi.MapiSession")
loMessage = CREATEOBJECT("MSMapi.MapiMessages")
...

I used the above code in my application and make it a EXE, on the user's machine (WinMe and 2K Server) I added the file MsMapi32.ocx and registered it with Regsvr32, but I still got the error:

"OLE Error Code 0x80040112: Appropriate license for this class not found"


Is there anything wrong ? I use VFP7.

I found two related articles for VFP6 in MSDN, but I don't know is it also applicable to VFP7:

139154 - INFO OLE Control Licensing in Visual FoxPro
192693 - BUG License Error with ActiveX Control Added at Run-Time




 
Thank you, Mike. I will try this way.
 
It doesn't work on my WinMe and W2K Server even I copy exactly the same code from "How To Send E-mail Programmatically Using MSMAPI OLE Control" and register the MsMapi32.ocx, maybe I should try the Install Shield.
 
MarvinR said:
It doesn't work on my WinMe and W2K Server

When you say that, what do you mean exactly? Are you getting an error, and if so what is it? The MSMAPI control MUST be dropped on a form in order for it to register properly on the user's machine as Mike said.

boyd.gif

[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
I created a EXE which contained only the code from "How To Send E-mail Programmatically Using MSMAPI OLE Control", than I tried it on a user's machine (WinMe and W2K Server) where MsMapi32.ocx is registered by Regsvr32.

The error is:
OLE Error Code 0x80040112: Appropriate license for this class not found.

Any idea ?
 
MarvinR,

I'm not quite sure what you're not understanding here...the reason you are getting the error is that you must put the MSMAPI control on a form...otherwise, whether the control has been registered with regsvr32 or not you will get that error. PUT THE CONTROL ON A FORM IN YOUR PROJECT...recompile, go install on the user's machine and that error will go away.

boyd.gif

 
Craig,

The Msmapi control is added on a form in my project as you said, but I just copied this new EXE to a user's machine, not using InstallShield. Is it the right way ?
 
Not sure then, the error you reported getting is due to the fact that that control requires a developers license...however, by placing the control on a form windows will handle properly registering the license in the registry (HKEY_CLASSES_ROOT\Licenses). Few things to try...unregister the control regsvr32 since you registered it using that. Then try it, if it still doesn't work then re-register the control and try it again. If it still doesn't work, then try using the actual control that is on the form to make your code work. If that still doesn't work, then I am out of suggestions...maybe somebody else can think of something.

I'd suggest exporting your registry license key for the mapi control and importing it on the user's machine, but that's probably a violation of some license agreement for that control.

boyd.gif

 
Thanks again Craig,

I think I will try to compare the registry licenses (HKEY...) with my developement machine first, if it doesn't work I will uninstall the old run-time than re-install with a new install program with MsMapi.ocx included.
 
Hi, MarvinR
Try to read KB Q139154 - INFO OLE Control Licensing in Visual FoxPro
(Distributing a Visual Class that Contains an Outline Control).
I use this variant and it is Ok.

HTH

Vlad Egorov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top