Menu

#658 COM+ header errors from not ifndefing it

v1.0 (example)
closed-works-for-me
nobody
None
5
2017-10-31
2017-08-31
No

there are a lot of errors generated so I attached the errors as a file. groups of errors like sections of a document got #included twice somehow, maybe with <windows.h> first?

includes are:

#include <windows.h>
//#include <winuser.h> //GetSystemMetrics
#include <shlobj.h> //SHGetFolderPath(), SUCCEEDED()
#include <string>
#include <vector>
#include <map>
#include <iterator>
#include <initializer_list>
#include <cctype>
#include <iostream>
#include <fstream>
#include <sstream>
#include <ios>
#include "stricmp.h"
#include "strip-ws.h"
#include "rnd.h"
#include <shobjidl.h>
#include <direct.h> //_mkdir()
//#include <windows.h>
#include <stdio.h>
#include <Unknwn.h>  //IUnknown QueryInterface,Release, AddRef
#include <initguid.h>
#include <wincodec.h> //IWICImagingFactory::CreateStream, IWICImagingFactory::CreateDecoderFromFilename,IWICStream::InitializeFromFilename, IWICBitmap
Encoder::Initialize, etc.
#include <objbase.h> //CoInitialize
//#include <Stringapiset.h> //MultiByteToWideChar
#include <comip.h> //MultiByteToWideChar
#include <comdefsp.h>
//#include <bidispl.h>
//#include <objidl.h> //grasping at straws
#include <Winbase.h> //HeapAlloc
//#include "stdafx.h"
#include <windows.h>
#include <winnls.h>
#include <shobjidl.h>
#include <objbase.h>
#include <objidl.h>
#include <shlguid.h>
#include <vfw.h>                //IPersistFile
#include <comdefsp.h>   //IPersistFile
#include <shlobj.h>     //CoCreateInstance
#include <objbase.h>    //CoCreateInstance
//#include "stdafx.h"
#include <windows.h>
#include <shobjidl.h>
#include <shlguid.h>
#include <strsafe.h>
#include <objidl.h>
//#include "windows.h"
//#include "stdio.h"
//#include "initguid.h"
//#include "wincodec.h"

the program is outmoded, it sets the desktop wallpaper once per boot. now we have windows 10 and it's no longer useful. but it seems to make a good test rig for the compiler. it's about 99% com+ in C++.

1 Attachments

Discussion

  • Jim Michaels

    Jim Michaels - 2017-08-31

    clue on how to fix:
    overview of header files:
    grep -n "#" *.h

    in header file:

    #if !defined(SOMEHEADER_H)
    #define SOMEHEADER_H "1.0"
    
    ...code
    
    #endif
    
     
  • Ozkan Sezer

    Ozkan Sezer - 2017-10-31

    Has anyone looked into this to see if it's a valid issue?

     
  • Kai Tietz

    Kai Tietz - 2017-10-31

    Ozkan, I stopped looking into op's reports ... I think it is save to close it as works-for-me. If we have here real issues, we will get sooner or later hopeful a report by a more responsive user.

     
  • Ozkan Sezer

    Ozkan Sezer - 2017-10-31
    • status: open --> closed-works-for-me
     
  • Ozkan Sezer

    Ozkan Sezer - 2017-10-31

    OK then, closing as works-for-me.

     

Log in to post a comment.