Avatar of Fraser_Admin
Fraser_Admin
Flag for Canada asked on

using cdo.dll in vb6 error

I'm trying to build a cdo 1.2 messaging application in vb6.  When I have the following code:
Set oSession = CreateObject("mapi.session")

I get the following error when i try to run...
ActiveX component can't create object.

I have included the cdo.dll in my project references.
Visual Basic Classic

Avatar of undefined
Last Comment
Fraser_Admin

8/22/2022 - Mon
Jim Horn

{Just as a wild guess}

Do you have this line before your Set statement

Dim oSession as MAPI.Session
Fraser_Admin

ASKER
hehehe yep.  i think the problem may be due to the fact that when outlook was installed the cdo stuff wasn't.

i tried just copying the cdo.dll to the proper directory, but maybe there is more to the installation that needs to be done?
Jim Horn

>i tried just copying the cdo.dll to the proper directory,
{Another wild guess, I'm on a roll...}
If you just copied the file, you still need to register it.  Go to Start button, run, type the below line, hit Ok button (requires some renaming):

regsvr32.exe c:\winnt\system32\wherever_the_heck_you_put_this\cdo.dll
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Fraser_Admin

ASKER
i get this when i try to register it.  even though it is definitly there.

---------------------------
RegSvr32
---------------------------
LoadLibrary("CDO.dll") failed - The specified module could not be found.


---------------------------
OK  
---------------------------
ASKER CERTIFIED SOLUTION
Jim Horn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Fraser_Admin

ASKER
i installed the outlook cdo component and all works good now.  thanks