Board index » cppbuilder » Unresolved external error message ---- I am desperate------

Unresolved external error message ---- I am desperate------

I have imported a type_library from a DLL. Cdo.dll and was apply to use the
.CPP in the application, and all went well.

I have added the object created from the application into a DLL application
and the head break loose. I am getting "Unresolved external error message"
error in the type library. I decided to take the OBJ out, and instead, added
the type library ".CPP" file, and the same error has continued. This works
very well in the application, but not in the DLL. This is the code that
produces this error

CDOObject::CDOObject(const char* name, const char* password)
{
    newSession = 0;

::CoCreateInstance(CLSID_Session,0,CLSCTX_REMOTE_SERVER,DIID__Session,(LPVOI
D*)&newSession);
    curSession = newSession;
    curSession.set_Session_(WideString("MAPI.SESSION"));
    curSession.Logon(name,password);
    cdoObj = this;

Quote
}

The error get created  right at the CoCreateInstance.

Please, I am desperate. I have had the confidence that since it work with
the application, It will work with DLL.

I need help please.

 

Re:Unresolved external error message ---- I am desperate------


Quote

>CDOObject::CDOObject(const char* name, const char* password)
>{
>    newSession = 0;

>::CoCreateInstance(CLSID_Session,0,CLSCTX_REMOTE_SERVER,DIID__Session,(LPVOI
>D*)&newSession);
>    curSession = newSession;
>    curSession.set_Session_(WideString("MAPI.SESSION"));
>    curSession.Logon(name,password);
>    cdoObj = this;
>}

For each new project I would do a import type library off the menu or
add the whatever_tlb.cpp to your projects.

I'm also not sure that you are creating the objects properly.

If you look at the header files generated from the type library import
you should see references to coclass default interface creators. They
are usually at the bottom.

ie

typedef TCoClassCreatorT<TCOMIXSLTemplate, IXSLTemplate,
&CLSID_XSLTemplate30, &IID_IXSLTemplate> CoXSLTemplate30;

So you should do something like

TCOMIXSLTemplate        tObj=CoXSLTemplate30::Create()

So you take the TCOM.. with the Co.. at the end

cheers,
John

Re:Unresolved external error message ---- I am desperate------


Thanks for in info. But this interface was imported. it was not created from
C++ Builder.  The type library is not dual interface. it only exposes
IDispatch. Therefore, they are two ways that  I know of (correct me if I am
wrong) 1  using BindDefault() or as I did it. Both gives the same error.

Quote
"John Moshakis" <john.mosha...@home.com> wrote in message

news:3b3365ac.4396211@newsgroups.borland.com...
Quote

> >CDOObject::CDOObject(const char* name, const char* password)
> >{
> >    newSession = 0;

>::CoCreateInstance(CLSID_Session,0,CLSCTX_REMOTE_SERVER,DIID__Session,(LPVO
I
> >D*)&newSession);
> >    curSession = newSession;
> >    curSession.set_Session_(WideString("MAPI.SESSION"));
> >    curSession.Logon(name,password);
> >    cdoObj = this;
> >}

> For each new project I would do a import type library off the menu or
> add the whatever_tlb.cpp to your projects.

> I'm also not sure that you are creating the objects properly.

> If you look at the header files generated from the type library import
> you should see references to coclass default interface creators. They
> are usually at the bottom.

> ie

> typedef TCoClassCreatorT<TCOMIXSLTemplate, IXSLTemplate,
> &CLSID_XSLTemplate30, &IID_IXSLTemplate> CoXSLTemplate30;

> So you should do something like

> TCOMIXSLTemplate tObj=CoXSLTemplate30::Create()

> So you take the TCOM.. with the Co.. at the end

> cheers,
> John

Other Threads