Solved

COM - based ActiveSync notification?

Posted on 2004-10-11
18
2,077 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 8
18 Comments
 
LVL 48

Expert Comment

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

Author Comment

by:LukaKrop
ID: 12276278
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
ID: 12277559
can you post that snippet of code where you got the errors?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:LukaKrop
ID: 12278405
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
ID: 12278935
http://www.mvps.org/vcfaq/lang/5.htm

Basically you have too add the library also

.lib
0
 

Author Comment

by:LukaKrop
ID: 12279118
yes probably

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

Expert Comment

by:Mikal613
ID: 12279216
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
ID: 12279291
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
ID: 12279340
http://www.opennetcf.org

i bet its there

Use there Framework
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12279376
did you link these

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

Author Comment

by:LukaKrop
ID: 12279379
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
ID: 12279383
0
 

Author Comment

by:LukaKrop
ID: 12279387
Yes I have link those and same effect
0
 
LVL 48

Accepted Solution

by:
Mikal613 earned 500 total points
ID: 12279417
vb6??

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

Author Comment

by:LukaKrop
ID: 12281030
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
ID: 12281335
not really
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12281346
what was the solution?
0
 

Author Comment

by:LukaKrop
ID: 12284577
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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