Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

COM - based ActiveSync notification?

Posted on 2004-10-11
18
Medium Priority
?
2,080 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
Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified 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
 

Author Comment

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

Accepted Solution

by:
Mikal613 earned 1500 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

730 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