Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook MAPI 80040112: Class is not licensed for use
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01034530
Message ID:
01034835
Vues:
30
The light goes off. I have to have that class as
DEFINE CLASS MyOLEMapi AS OLEControl 
and then instantiate that in object
DEFINE CLASS SendMail AS CUSTOM
Failure to read carefully strikes again... thanks for the help.


>I don't see where you've created a subclass for the Olecontrol?
>
>>So if the subclass is okay why did mine fail? I'll include the class below in case I'm not understanding the articles instructions.
>>
>>
>>*******************************************************************************
>>* MAPI E-Mail
>>*
>>* Class:        sendmail
>>* ParentClass:  custom
>>* BaseClass:    custom
>>* Include file: email.h
>>*******************************************************************************
>>
>>#include email.h
>>
>>define class sendMail as custom
>>	height = 0
>>	width = 0
>>	name = "mapimail"
>>	
>>	cSubject = ''				&& e-mail subject
>>	cMessageBody = ''			&& e-mail body text
>>	lSignoffAfterSend = .T.		&& sign off MAPI session after send if true
>>	lLogonUI = .F.				&& display e-mail login dialog if true
>>	lNewSession = .F.			&& use an existing Mapi session if available if false
>>		
>>	protected aAttachments[1]	&& e-mail attachment(s)
>>	protected aRecipients[1]	&& e-mail addressee - semicolon seperated list
>>	protected lSession 			&& true if MAPI session established
>>	protected oSession			&& reference to MAPI Session object
>>	protected oMessage			&& reference to MAPI Message object
>>	protected lCanceled			&& user canceled send if true
>>	
>>	* ProgIDs of MAPI message and session and registry info for MAPI
>>	protected cMAPImessageProgID
>>	protected cMAPIsessionPROGID
>>	protected cMAPIdll
>>	protected cMAPIsubkey
>>	protected cDLLname
>>	protected cMAPIProfileSubkey
>>	
>>	cMAPImessageProgID = "MSMAPI.MAPIMESSAGES"
>>	cMAPIsessionPROGID = "MSMAPI.MAPISESSION"
>>	cMAPIdll 			 = "MAPI32.dll"
>>	cMAPIsubkey 		 = "Software\Microsoft\Windows Messaging Subsystem"
>>	cDLLname 			 = "CMCDLLNAME32"
>>	cMAPIProfileSubkey = "Software\Microsoft\Windows NT\CurrentVersion\" + ;
>>						 		"Windows Messaging Subsystem\Profiles"
>>	
>>	
>>	* ensure mapi dll is available, instantiate the MAPI session and
>>	* message objects, and signon to MAPI
>>	procedure init
>>		dodefault()
>>		
>>		with this
>>			* initilize parameters
>>			.reset()
>>			
>>			* ensure MAPI dll is available
>>			if (not .mapiExists())
>>				Cs_Raise_errhand("Cannot find " + .cMAPIdll, .T.)
>>				return .F.
>>			endif
>>			
>>			* instantiate the MAPI session object
>>			.oSession = createobject(.cMAPIsessionPROGID)
>>			if vartype(.oSession) != 'O'
>>				Cs_Raise_errhand("Cannot instatiate MAPI Session: " + .cMAPIsessionPROGID, .T.)
>>				return .F.
>>			endif
>>			
>>			* instantiate the MAPI message object
>>			.oMessage = createobject(.cMAPImessageProgID)
>>			if vartype(.oMessage) != 'O'
>>				Cs_Raise_errhand("Cannot instatiate MAPI MEssage: " + .cMAPImessageProgID, .T.)
>>				.oSession = .NULL.
>>				return .F.
>>			endif
>>		
>>			* signon to MAPI
>>			.signOn()
>>			if not .lSession
>>				Cs_Raise_errhand("Cannot signon to MAPI", .T.)
>>				.oSession = .NULL.
>>				.oMessage = .NULL.
>>				return .F.
>>			endif
>>		endwith
>>	endproc
>>	
>>	*!* Code Truncated For Message Space *!* 	
>> 	.
>> 	.
>> 	.
>> 	.
>> 	
>>enddefine
>>
>>
>>>In a later reply to this thread, I've said that the subclass is a viable option...
>>>
>>>Re: Outlook MAPI 80040112: Class is not licensed for use Thread #1034530 Message #1034540
>>>
>>>...I mentioned the form as it is the way that MS suggests to do it in one of their KB Articles. You can see that KB Article and a question I posed to Ken Levy for clarification on this whole issue in the following thread...
>>>
>>>Appropriate License Registry Hack Violation? Thread #1034545 Message #1034545
>>>
>>>...both the form and the subclass are viable options. It's the registry hack that I have questions about and the issue that I think needs to be cleared up by MS. If the registry hack is viable (OK with MS), then that's the way I'll do it from now on since it doesn't require that a Form or a Subclass be created in the application.
>>>
>>>>Interesting.
>>>>
>>>>I read the second article from Microsoft. I interpreted the following
>>>>
>>>>Add the control you want to use into a class that is saved in a Visual Class library or into a class created with the DEFINE CLASS command
>>>>
>>>>to mean that if you put the MS Mapi object inside any DEFINE CLASS including CUSTOM you were okay.
>>>>
>>>>Are you saying it has to be a FORM class and that a CUSTOM will not suffice?
>>>>
>>>>Thanks
>>>>>http://www.tek-tips.com/viewthread.cfm?qid=720369
>>>>>http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3BQ139154
>>>>>http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3BQ192693
>>>>>
>>>>>To save you some time in reading the above, the problem is related to the fact that you never placed the MAPISession and MAPIMessage ActiveX controls on a form in your VFP project. Doing this allows you to correctly register the controls on the user's machine. If you don't have a form where you can place them for the code you are running, an invisible one that just handles this for you will work fine.
>>>>>
>>>>>
>>>>>>I am receiving the following error when instantiating a MAPI client class within my Visual FoxPro 6 SP5 application:
>>>>>>
>>>>>>80040112: Class is not licensed for use
>>>>>>
>>>>>>The error occurs at the point where a Mapi Session or Message is being created with one of these two lines:
>>>>>>
>>>>>>.oSession = createobject("MSMAPI.MAPISESSION")
>>>>>>.oMessage = createobject("MSMAPI.MAPIMESSAGES")
>>>>>>
>>>>>>Anyone have any thoughts? I'll continue below with what I've tried so far.
>>>>>>
>>>>>>[Debugging Done to find Issue]
>>>>>>1) Windows XP SP2 with Microsoft Office 2000 and SP1 Virtual PC for testing
>>>>>>
>>>>>>2) This issue is most likely a missing DLL, OCX, or registry "license" key. Thus most of my testing has been along this route
>>>>>>
>>>>>>3) I tried the watch utility in installsheild to monitor what is being used. I then included those files, or the MSI Merge Module containing them, in my installation routine and installed. No Joy
>>>>>>
>>>>>>4) I then moved to manual searches of differences in Mapi files between my Dev machine and the failed client. The only thing I find missing is MAPIR.DLL located in the C:\Program Files\Common Files\SYstem\MSMAPI\1033\MAPIR.DLL. I moved that file into the location (copying from Dev) and tried a regsvr32.exe. I get the DLLEntryPoint Server Not Found error when attempting to register. The license error still occurs in my application on the test machine. I can not find any information on what MAPIR.dll does in terms of MAPI
>>>>>>
>>>>>>5) I then installed Visual Studio 6 on the machine. Viola... everything works. So at this stage I know one thing... whatever the problem, installing Visual Studio Fixes it.
>>>>>>
>>>>>>6) Then tried the same install on Windows 2000 with Office 2000 on a seperate Virtual machine. This was done in case problems with the office install were the culprit... No Joy... same error.
>>>>>>
>>>>>>7) Since then I've tried a myriad of installs and unistalls (the virtual machine is returned to unloaded state each time, no dll/ocx etc) varying different DLLs in an attempt to fix... No Joy
>>>>>>
>>>>>>I could go on for hours with what I've tried but I think this information is the most useful.
>>>>>>
>>>>>>Okay Thread... I need some saving.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform