Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Microsoft Mapi Solution Fails! Any Ideas??
Message
From
10/10/1997 16:36:46
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00054055
Message ID:
00054102
Views:
24
>>>>The solution is addapted from information found on the Microsoft Knowledge Base. The program runs great on my machine that has the full 5.0a Version installed but fails on a machine with only the 5.0 Drivers installed.
>>>>
>>>>The Error I recieve is ole error code 0x80040112. Appropriate License for this class not found.
>>>>
>>>>I have created a prg and turned it into an exe which is run from the start|run window.
>>>>The code is as follows as suggested by MS.:
>>>> loForm = CREATEOBJECT("form")
>>>> loForm.addobject("Session1", "olecontrol", "MSMAPI.mapiSession")
>>>> loForm.addobject("Message1", "olecontrol", "MSMAPI.mapiMessages")
>>>>
>>>>Line two fails on the machine with only the drivers installed.
>>>>I have installed and registered the MSMapi controls.
>>>>
>>>>The documentation does not list any classes to include with the prg.
>>>>
>>>>
>>>>I was able to make this work by building a form and adding the two controls to the form. When I turned the form into an exe, it runs great on the machine with drivers only. The reason I don't want to run it this way was the prg was easier to manipulate and the form flashes on the screen for a second before the invisible command is executed.
>>>>
>>>>
>>>>Does anyone have any suggestions on how I can get the exe with the addobject(msmapi) code to work on a machine that contains the VFP5 drivers only?
>>>>
>>>>Thanks,
>>>>
>>>>Michael
>>>
>>>Hi Michael
>>>
>>>I used the same logic and it works great.
>>>Add msmapi32.ocx to the user machine or the network machine.
>>>If you are using setup add msmapi32 as active X.
>>>
>>>Mo
>>
>>Thanks Mo,
>>
>>I already have the ocx installed and registered on the machine.


I found in the knowledge base a reason why it fails as an exe from a prg but works as an exe from a form.
The following is taken from article id: q139154.

"Visual FoxPro will not allow an OLE control to be created or instantiated unless the correct license is present."

"License information is saved with the form or class. This allows distributed forms to run successfully on
workstation that do not have a design-time license."

This is why the exe built out of a form works on the same machine that the exe built from a prg does not.
The run time license does not exist for the exe with the form created from the prg.

Thanks for you help.

Michael
>>I can see it in the NT directory.
>>
>>Why does the control work on a form but not on a created form in a prg??
>>
>>Michael
>
>Michael, sometimes an entry in the registry is removed by another program. There's a program in the Files section here which will re-install the registry entry: FOXREG.ZIP in the Files section. It gives you the necessary registry information which can be imported through RegEdit.
>
>HTH
>Barbara
Previous
Reply
Map
View

Click here to load this message in the networking platform