Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MSMAPI error

77 views
Skip to first unread message

Brian Abbott

unread,
Nov 11, 2003, 3:44:47 PM11/11/03
to
I've created a small vb.net app that uses MAPI to send
email. It works fine on my development computer.
I created an InstallShield setup, which includes MSMAPI
and Interop.MSMAPI.dll.
But when this is installed on another box (WinXP in this
case), and when the routine containing my MAPI calls is
run, I get an error:

System.Runtime.InteropServices.COMException (0x80040112):
Class is not licensed for use

I've used this MAPI before w/VB6 and have never had a
problem. Could anyone shed any light on this problem? I
don't even know where to start. Thanks, I sure appreciate
it.

Thanks
Brian

Ying-Shen Yu[MSFT]

unread,
Nov 12, 2003, 8:08:44 AM11/12/03
to
Hi Brain,

Thanks for your post!

You may take a look on this KB Article,
<PRB: Errors When You Use Visual Basic 6.0 Controls in Visual Studio .NET>
http://support.microsoft.com/default.aspx?scid=kb;en-us;318597

If you still have problem, please be free to reply to this thread.
Thanks!


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending.


Brian Abbott

unread,
Nov 12, 2003, 12:45:24 PM11/12/03
to
Hi Ying-Shen

Thanks for the reply! But I don't think that is my
problem. I do have VB6 sp5, and VS.net 2003 on the same
computer (the development computer, a Win2000 box). On
this computer, everything works fine. My problem is when
the .net developed application is installed on another
machine.

During development, in .net 2003, I added a reference to
Microsoft MAPI Controls 6.0. This of course created
Interop.MSMAPI.dll.

To deploy this app I used InstallShield to create a
setup.exe. This setup included my app, Interop.MSMAPI.dll,
and Microsoft MAPI Controls 6.0 (msmapi32.msm), and some
dependencies (MS component category manager library, MS
ole 2.4).

I tested this by deploying the setup.exe to another
computer that did not have VB6 or VS.NET on it. It did
have the .net framework 1.1 on it, along with Office 2000.

After installing it, when I ran the app, and clicked the
button that called my mapi calls, I got the following
error.

System.Runtime.InteropServices.COMException (0x80040112):
Class is not licensed for use

I verified that msmapi32.ocx was on the test computer.
However, I noticed that the timestamps were different. On
the development box msmapi32.ocx was 6-24-98, while on the
text box, msmapi32.ocx was 4-3-00.

FWIW, I have created apps using mapi using vb6 on the same
development box, and tested on the same test box, and
never had a problem.

I hope this describes my problem better. If there is any
more information you need, just let me know and I'll be
happy to provide it.

Thank you VERY much for your help.
Brian

>.
>

Ying-Shen Yu[MSFT]

unread,
Nov 13, 2003, 2:55:07 AM11/13/03
to
Hi Brian,

Thanks for your reply!

I'd like to know how did you use the MAPI Control in VB.NET?
Did you add it as an ActiveX control or reference the COM library only?

If you only referenced the COM Library and create the MAPI Control like:

MSMAPI.MAPISession sess = new MSMAPI.MAPISessionClass();
sess.AboutBox();

You might have this problem, because the MAPI Control will not aware it's
run-time, it still want to load the
design-time license.
You may try using it as an ActiveX Control
1 right "Tools->Add/Remove Items", then click on "COM Components"
2 add "Microsoft MAPI Message Control" and "Microsoft MAPI Session
Control".
3. put the MAPI Session Box on the form
4. "axMAPISession1.AboutBox();" in a button click event handler.

If you still have problem on it , please reply to this thread to let me
know!
Thanks!


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending.

--------------------
| Content-Class: urn:content-classes:message
| From: "Brian Abbott" <abb...@abbott.abbott>
| Sender: "Brian Abbott" <abb...@abbott.abbott>
| References: <108f01c3a894$a5449fb0$a001...@phx.gbl>
<1dqKs4Rq...@cpmsftngxa06.phx.gbl>
| Subject: RE: MSMAPI error
| Date: Wed, 12 Nov 2003 09:45:24 -0800
| Lines: 81
| Message-ID: <080d01c3a944$c08c3430$a501...@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOpRMCMQo4w5jocSdiEQPZH6y/P1A==
| Newsgroups: microsoft.public.dotnet.framework.interop
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.interop:20300
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.framework.interop

Brian Abbott

unread,
Nov 13, 2003, 2:48:24 PM11/13/03
to
Hi Ying-Shen

You nailed it! The problem, and the fix, was exactly as
you wrote in your last msg.

THANKS A BUNCH!

Brian

>.
>

Brian Abbott

unread,
Nov 14, 2003, 4:02:01 AM11/14/03
to
Hi Ying-Shen

Your last suggestion was right on. I did as you suggested
and everything works just fine now.

Thanks a BUNCH!
Brian

>.
>

Ying-Shen Yu[MSFT]

unread,
Nov 14, 2003, 5:58:28 AM11/14/03
to
Hi Brian,

Thanks! I'm glad to hear you have resolved the problem.
Please be free to share your problems as well as solutions with the whole
community!

0 new messages