Solved

COM - based ActiveSync notification?

Posted on 2004-10-11
18
2,073 Views
Last Modified: 2013-11-18
Hello

I am trying to develop a desktop app which will connect to PDA (Pocket PC).
My app must get notified befor initializing RAPI. On microsoft web site I found....

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceactsy/html/ceconcom-basednotification.asp

I understand everything but when I try to compile it I get LINK errors:

PDA.obj : error LNK2001: unresolved external symbol _CLSID_DccMan
DPDA.obj : error LNK2001: unresolved external symbol _IID_IDccMan
MySinkObject.obj : error LNK2001: unresolved external symbol _IID_IDccManSink
Debug/DPDA.exe : fatal error LNK1120: 3 unresolved externals

This looks like the linker must have a lib?? But I cannot find it anywhere ...

I don't know what to do... I have tried everything

I am using Visual Studio 6.0 and MFC...

Thnx for your help..

best regards
0
Comment
Question by:LukaKrop
  • 10
  • 8
18 Comments
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
There all in Rapi.dll  but the link you referred to is for CE.NET 4.2
0
 

Author Comment

by:LukaKrop
Comment Utility
I know that the link is fo .NET but the same functions are also for not .NET framework...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceconct/html/_wcesdk_Notification_Procedures.asp

I have also tried with rapi.dll (including lib) but same effect...
0
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
can you post that snippet of code where you got the errors?
0
 

Author Comment

by:LukaKrop
Comment Utility
OK first my derived code from IDccManSink class

class CMySinkObject : public IDccManSink  
{
public:
      CMySinkObject();
      ~CMySinkObject();
// IUnknown methods:
   STDMETHODIMP_(DWORD) AddRef(void);
   STDMETHODIMP QueryInterface(REFIID riid, void ** ppv);
   STDMETHODIMP_(DWORD) Release(void);
      // IDccManSink methods;
   STDMETHODIMP OnLogAnswered(void);
   STDMETHODIMP OnLogActive(void);
   STDMETHODIMP OnLogDisconnection(void);
   STDMETHODIMP OnLogError(void);
   STDMETHODIMP OnLogInactive(void);
   STDMETHODIMP OnLogIpAddr(DWORD dwIpAddr);
   STDMETHODIMP OnLogListen(void);
   STDMETHODIMP OnLogTerminated(void);
private:
   DWORD m_dwRefCount;
};

and implementation

#include "stdafx.h"
#include "DPDA.h"
#include "MySinkObject.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMySinkObject::CMySinkObject()
{

}

CMySinkObject::~CMySinkObject()
{
      
}

STDMETHODIMP CMySinkObject::OnLogAnswered(void)
{
      AfxMessageBox(_T("OnLogAnswered"));
      return NOERROR;
}

STDMETHODIMP CMySinkObject::OnLogActive(void)
{
      AfxMessageBox(_T("OnLogActive"));
      return NOERROR;
}

STDMETHODIMP CMySinkObject::OnLogDisconnection(void)
{
      AfxMessageBox(_T("OnLogDisconnection"));
      return NOERROR;
}

STDMETHODIMP CMySinkObject::OnLogError(void)
{
      AfxMessageBox(_T("OnLogError"));
      return NOERROR;
}

STDMETHODIMP CMySinkObject::OnLogInactive(void)
{
      AfxMessageBox(_T("OnLogInactive"));
      return NOERROR;
}

STDMETHODIMP CMySinkObject::OnLogIpAddr(DWORD dwIpAddr)
{
      AfxMessageBox(_T("OnLogIpAddr"));
      return NOERROR;
}

STDMETHODIMP CMySinkObject::OnLogListen(void)
{
      AfxMessageBox(_T("OnLogListen"));
      return NOERROR;
}      

STDMETHODIMP CMySinkObject::OnLogTerminated(void)
{
      AfxMessageBox(_T("OnLogTerminated"));
      return NOERROR;
}


STDMETHODIMP_(DWORD) CMySinkObject::AddRef(void)
{
  return ++m_dwRefCount;

}
STDMETHODIMP CMySinkObject::QueryInterface(REFIID riid, void ** ppv)
{
    if( IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IDccManSink))
    {
        *ppv = (IDccManSink *)this;
    }
    else
    {
        *ppv = NULL;
        return E_NOINTERFACE;
    }

    AddRef();
    return S_OK;
}
STDMETHODIMP_(DWORD) CMySinkObject::Release(void)
{
    ULONG   ul = m_dwRefCount;

    if (!--m_dwRefCount)
        delete this;

    return ul;
}

in App derived class I added variable members:

DWORD m_hrDccMan;
IDccMan* pDccMan;
HRESULT hr;
CMySinkObject m_mySkin;


in application I add to InitInstance() code:

hr = CoCreateInstance(CLSID_DccMan, NULL, CLSCTX_INPROC_SERVER, IID_IDccMan, (LPVOID*) &pDccMan);
pDccMan->Advise((CMySinkObject*)&m_mySkin, &m_hrDccMan);

and in ExitInstance I added:

pDccMan->Unadvise(m_hrDccMan);

when I compile I get this error linker:

Linking...
DPDA.obj : error LNK2001: unresolved external symbol _CLSID_DccMan
DPDA.obj : error LNK2001: unresolved external symbol _IID_IDccMan
MySinkObject.obj : error LNK2001: unresolved external symbol _IID_IDccManSink
Debug/DPDA.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.

DPDA.exe - 4 error(s), 0 warning(s)

0
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
http://www.mvps.org/vcfaq/lang/5.htm

Basically you have too add the library also

.lib
0
 

Author Comment

by:LukaKrop
Comment Utility
yes probably

but I cannot find .lib file for this OLE
0
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
Sorry

http://support.microsoft.com/default.aspx?scid=%2Fservicedesks%2Fbin%2Fkbsearch.asp%3FArticle%3D299891

Building Modules That Use RAPI
The Rapi.h header file and Rapi.lib library file are available for use in compiling and linking desktop code to use RAPI. The header file and library files for use with RAPI functions are found in the following folder in a typical installation:

C:\Windows CE Tools\wce300\MS Pocket PC\support\ActiveSync\Inc
C:\Windows CE Tools\wce300\MS Pocket PC\support\ActiveSync\Lib
To compile the device-side DLL, you can use the same Rapi.h file mentioned earlier. There is no RAPI library file necessary to create the device DLL.

NOTE: RAPI.dll is not redistributable. It is installed when ActiveSync is installed on the desktop host computer.
0
 

Author Comment

by:LukaKrop
Comment Utility
I have linked already RAPI but I don't think that this is the case because I cannot find IDccMan interface in RAPI...
0
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
http://www.opennetcf.org

i bet its there

Use there Framework
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
did you link these

??
Header: Dccole.h.
Link Library: Ole32.lib, Uuid.lib
0
 

Author Comment

by:LukaKrop
Comment Utility
I have already found this but I still have Visual Studio 6.0 with MFC and this one is .NET... I think I am not able to use it...
0
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
0
 

Author Comment

by:LukaKrop
Comment Utility
Yes I have link those and same effect
0
 
LVL 48

Accepted Solution

by:
Mikal613 earned 500 total points
Comment Utility
vb6??

I think your gonna need a .net language its based on the framework
0
 

Author Comment

by:LukaKrop
Comment Utility
Ok I have found solution, on MFC form told me a guy
thanks anyway for your help
I will give you all the points

only one question if you know
do you know which would be the best solution (hardware) to be able to scan bar codes with my HP IPAQ.
Is solution from SOCKET ok?

best regards
0
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
not really
0
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
what was the solution?
0
 

Author Comment

by:LukaKrop
Comment Utility
I have written an database application in C++. User can print invoices and packet lists etc...
I was thinking that for input the user could use some sort of bar code scanner

which one would be th best for this task?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article shows how to setup the internet connectivity on Windows Mobile Emulator.   I assume that you already have Microsoft Visual Studio, Microsoft Windows Mobile SDK's and the emulator installed. The emulator is available with Visual Studi…
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now