Click here to Skip to main content
14,774,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm getting these errors on this small piece of code.
Error   1   error LNK2019: unresolved external symbol _CoInternetIsFeatureEnabled@8 referenced in function _wmain   
Error   2   error LNK2019: unresolved external symbol _CoInternetSetFeatureEnabled@12 referenced in function _wmain 
Error   3   error LNK1120: 2 unresolved externals  


Here is the code.......
#include "stdafx.h"
#include <urlmon.h>

int _tmain(int argc, _TCHAR* argv[])
{
	
    LRESULT lr = 0;
    INTERNETFEATURELIST featureToEnable = FEATURE_RESTRICT_FILEDOWNLOAD;
    
    if (SUCCEEDED(CoInternetSetFeatureEnabled(featureToEnable, SET_FEATURE_ON_PROCESS, true)))
    {
        if (FAILED(CoInternetIsFeatureEnabled(featureToEnable,SET_FEATURE_ON_PROCESS)))
        {
            lr = 2;
        }
    }
    else
    {
        lr = 1;
    }
	return 0;
}
Posted
Updated 10-Sep-11 18:30pm
v2

1 solution

add a
#pragma comment(lib,"urlmon.lib")
before
int _tmain(...)


You're missing that static lib from your link
   
Comments
Member 7766180 11-Sep-11 3:20am
   
Thank You! It worked!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900