recently i was reading a tutorial about the ole api and i think i managed to get through the whole tutorial but when i try to use some of the functions the tutorial uses like oleuninitialize then i get an error saying undefined reference i would like to know what exactly i'm missing.
these files are supposed to be defined in windows.h from what the tutorial said. and i'd also like to know is there any way to turn ur custom defined window into a explorer like window so that when someone drops a file onto it, the icon of the file will be displayed on the window just like its done on the desktop. if you could provide any tutorials which would teach me this that would be great. thanks

1. You didn't mention which tutorial you read, so we don't know whether it was any good or just some 10+ year old hack for an older operating system.

2. You didn't say which OS/Compiler you're using now.

3. You didn't show us the code you tried.

> if you could provide any tutorials which would teach me this that would be great
More mind reading required. Which have you read and found to be
- wrong
- too easy
- too hard

Try google again.

i am currently doing my programming on windows xp home edition service pack 2;
i am using dev c++ compiler 4.9.9.2

the name of the tutorial i read is titled "ole drag and drop from scratch"
and here is the link: http://www.catch22.net/tuts/dragdrop.asp

and my code is

#include <"windows.h">
#include <"iostream">

LRESULT CALLBACK WinMain(HINSTANCE inst,HINSTANCE pinst,LPSTR cmdln, int show)
{
 OleInitialize(0);
 OleUninitialize();
}

i am currently doing my programming on windows xp home edition service pack 2;
i am using dev c++ compiler 4.9.9.2

the name of the tutorial i read is titled "ole drag and drop from scratch"
and here is the link: http://www.catch22.net/tuts/dragdrop.asp

and my code is

#include <"windows.h">
#include <"iostream">

LRESULT CALLBACK WinMain(HINSTANCE inst,HINSTANCE pinst,LPSTR cmdln, int show)
{
 OleInitialize(0);
 OleUninitialize();
}

Include also <OLE2.H>

And change the WinMain to

[B]int WINAPI [/B]WinMain(      
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow
);
#include <"windows.h">
#include <"iostream">

Do not use both angle brackets and quotes. One or the other. Use angle brackets for your compiler's header files and quotes for the header files that you create.

#include <windows.h>
#include <iostream>

After a successful compile you will get errors about undefined references to OldInitialize() and OleUnitialize(). You have to include libole32.a in the linker commands. So far I have not been able to get that compiler to successfully link the program.

i'd like to thank everyone for their responses and i got the program to work when i added libole32 to the project, is it also possible for me to get a little guidance on my other problem about getting my window to behave like an explorer window and display the icons of files being transfered to it ?

If you use MFC you can use a Splitter Window and Tree Control. I'm sure you can do it without MFC but it will be a whopping lots of work and code. And of course to use MFC you will have to use a Microsoft compiler (not the free Express editions) because Dev-C++ doesn't support it.

ok thanks for you help, thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.