Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5956279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:14:03+00:00 2026-05-22T18:14:03+00:00

Alright, so I’ve been messing around with some Microsoft Windows Update APIs and am

  • 0

Alright, so I’ve been messing around with some Microsoft Windows Update APIs and am attempting to have some asynchronous downloading. The API class class for a callback reference for a class that uses the IDownloadProgressChangedCallback interface More Info About The API Can Be Found Here. What I have done so far is just a shot in the dark (I’ve never messed with callbacks or asynchronous code, or Microsoft API’s for that matter). I keep getting issues with having the same methods being “already defined”. Here is what I have so far:

Relevent code in main method:

IDownloadJob *_DownloadJob = NULL;
tagVARIANT NodeValue ; \\>>PS<< HOW DO I SET THIS TO A DEFUALT VALUE?
hr = _UpdateDownloader->BeginDownload(new DownloadProgressChangedCallback  ,new DownloadCompletedCallback, NodeValue,&_DownloadJob);

DownloadProgressChange.h:

#include <Wuapi.h>
#pragma once
class DownloadProgressChangedCallback  : public IDownloadProgressChangedCallback 
{
public:
    HRESULT STDMETHODCALLTYPE Invoke( IDownloadJob *downloadJob,  IDownloadProgressChangedCallbackArgs *callbackArgs);
    HRESULT STDMETHODCALLTYPE QueryInterface(  REFIID riid,  __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject);
    ULONG STDMETHODCALLTYPE AddRef( void) ;
    ULONG STDMETHODCALLTYPE Release( void);
};

DownloadProgressChange.cpp:

#include "StdAfx.h"
#include "DownloadProgressChange.h"
HRESULT STDMETHODCALLTYPE Invoke( IDownloadJob *downloadJob,  IDownloadProgressChangedCallbackArgs *callbackArgs)
{
    return NULL;
}

HRESULT STDMETHODCALLTYPE QueryInterface(  REFIID riid,  __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject)
{
    return NULL;
}

ULONG STDMETHODCALLTYPE AddRef( void) 
{
    return NULL;
}

ULONG STDMETHODCALLTYPE Release( void)
{
    return NULL;
}

DownloadCompletedCallback.h

#include <Wuapi.h>
#pragma once
class DownloadCompletedCallback  : public IDownloadCompletedCallback 
{
public:
    HRESULT STDMETHODCALLTYPE Invoke( IDownloadJob *searchJob,  IDownloadCompletedCallbackArgs *callbackArgs);
    HRESULT STDMETHODCALLTYPE QueryInterface(  REFIID riid,  __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject);
    ULONG STDMETHODCALLTYPE AddRef( void) ;
    ULONG STDMETHODCALLTYPE Release( void);
};

DownloadCompletedCallback.cpp

#include "StdAfx.h"
#include "DownloadCompletedCallback.h"
HRESULT STDMETHODCALLTYPE Invoke( IDownloadJob *searchJob,  IDownloadCompletedCallbackArgs *callbackArgs)
{
    return NULL;
}

HRESULT STDMETHODCALLTYPE QueryInterface(  REFIID riid,  __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject)
{
    return NULL;
}

ULONG STDMETHODCALLTYPE AddRef( void) 
{
    return NULL;
}

ULONG STDMETHODCALLTYPE Release( void)
{
    return NULL;
}

And Here Is The Response From The Build Output:

1>------ Build started: Project: WinGet, Configuration: Debug Win32 ------
1>Build started 5/29/2011 10:29:15 PM.
1>InitializeBuildStatus:
1>  Touching "Debug\WinGet.unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>  All outputs are up-to-date.
1>ManifestResourceCompile:
1>  All outputs are up-to-date.
1>DownloadProgressChange.obj : error LNK2005: "long __stdcall QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@@YGJABU_GUID@@PAPAX@Z) already defined in DownloadCompletedCallback.obj
1>DownloadProgressChange.obj : error LNK2005: "unsigned long __stdcall AddRef(void)" (?AddRef@@YGKXZ) already defined in DownloadCompletedCallback.obj
1>DownloadProgressChange.obj : error LNK2005: "unsigned long __stdcall Release(void)" (?Release@@YGKXZ) already defined in DownloadCompletedCallback.obj
1>WinGet.obj : error LNK2001: unresolved external symbol "private: virtual long __stdcall DownloadCompletedCallback::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@DownloadCompletedCallback@@EAGJABU_GUID@@PAPAX@Z)
1>WinGet.obj : error LNK2001: unresolved external symbol "private: virtual unsigned long __stdcall DownloadCompletedCallback::AddRef(void)" (?AddRef@DownloadCompletedCallback@@EAGKXZ)
1>WinGet.obj : error LNK2001: unresolved external symbol "private: virtual unsigned long __stdcall DownloadCompletedCallback::Release(void)" (?Release@DownloadCompletedCallback@@EAGKXZ)
1>WinGet.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall DownloadCompletedCallback::Invoke(struct IDownloadJob *,struct IDownloadCompletedCallbackArgs *)" (?Invoke@DownloadCompletedCallback@@UAGJPAUIDownloadJob@@PAUIDownloadCompletedCallbackArgs@@@Z)
1>WinGet.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall DownloadProgressChangedCallback::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@DownloadProgressChangedCallback@@UAGJABU_GUID@@PAPAX@Z)
1>WinGet.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall DownloadProgressChangedCallback::AddRef(void)" (?AddRef@DownloadProgressChangedCallback@@UAGKXZ)
1>WinGet.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall DownloadProgressChangedCallback::Release(void)" (?Release@DownloadProgressChangedCallback@@UAGKXZ)
1>WinGet.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall DownloadProgressChangedCallback::Invoke(struct IDownloadJob *,struct IDownloadProgressChangedCallbackArgs *)" (?Invoke@DownloadProgressChangedCallback@@UAGJPAUIDownloadJob@@PAUIDownloadProgressChangedCallbackArgs@@@Z)
1>C:\Users\Nathan\Documents\Visual Studio 2010\Projects\WinGet\Debug\WinGet.exe : fatal error LNK1120: 8 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.04
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:14:04+00:00Added an answer on May 22, 2026 at 6:14 pm

    In your .cpp files, you need to specify the fully-qualified name of the member function you are defining:

    HRESULT STDMETHODCALLTYPE DownloadProgressChangedCallback::Invoke( IDownloadJob *downloadJob,  IDownloadProgressChangedCallbackArgs *callbackArgs)
    

    [etc.]

    Without the DownloadProgressChangedCallback:: prefix, you are just defining a global function named “Invoke”. The linker is complaining because (a) you have done that twice and (b) you have not defined the actual member functions you declared.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, I have been doing the following (variable names have been changed): FileInputStream fis
Alright I want to create a .csv file in C#. I have been looking
Alright, currently I have my SWF hitting a php file that will go and
Alright. So I have a very large amount of binary data (let's say, 10GB)
Alright. I have a query that looks like this: SELECT SUM(`order_items`.`quantity`) as `count`, `menu_items`.`name`
Alright, so I have a query that looks like this: SELECT `orders`.*, GROUP_CONCAT( CONCAT(
Alright, I have a div which is 50px (height), and the width does not
Alright, I guess this question has been asked a lot of times here. I
Alright. So I figure it's about time I get into unit testing, since everyone's
Alright, I'm trying to read a comma delimited file and then put that into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.