Hi,
I am experiencing a problem when I use the file dialog from the website smorgasbordet. I do not understand it.
What I first did: I used the program 'as is' and it worked. Then I copied the code my own program, line by line, and got an error very soon.
The code is:
HRESULT Simple_FileOpenDialog(HWND hwndParent)
{
IFileOpenDialog *pfod = NULL; /* (IFileSaveDialog is similar) */
// Create the File Open Dialog COM object.
HRESULT hr = CoCreateInstance(&CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER, &IID_IFileDialog, (void **)&pfod);
The last line here gives two linker errors:
Unresolved external symbol 'CLSID_FileOpenDialog'
Unresolved external symbol 'IID_IFileDialog'
These symbols are in the file shobjidl.h which I included.
In fact, I included all headers as in the sample:
#include <windows.h>
#define COBJMACROS
#include <shobjidl.h> /* for IFileDialog, IFileOpenDialog, IFileSaveDialog */
#include <knownfolders.h> /* for known folder APIs and definitions */
#include <wchar.h>
I have no idea what I am doing wrong. Any suggestions? Would be appreciated...