Skip to main content
GameDev.net gamedev.net
🔒 Locked

CoInitializeEx Help!

Started by Talib Jul 9, 2004 at 3:05 AM 3 replies 1k views
Original Post
Talib
Talib
Hi I was planning to try the cutscene example from dx9. I started by stripping all the command line stuff (make the thing more readable and reconstructing it line by line (btw thats how I learn from example .. reading the help file for everything I don't understand) Here is my code so far:

#include <windows.h>
#include <dshow.h>
#include <stdio.h>
#include <atlbase.h>
#include <objbase.h>
//included almost everything to try and make it work .. might try the kitchen sink next

LRESULT WINAPI WindowProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam )
{
    switch( Msg )
    {
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
    }

    

    return DefWindowProc(hWnd, Msg, wParam, lParam);
}

int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	HWND hWnd;
	HRESULT hr;

	WNDCLASS wc      = {0};
    wc.lpfnWndProc   = (WNDPROC) WindowProc;
    wc.hInstance     = hInstance;
    wc.lpszClassName = "Hidden Window";

	if (!RegisterClass(&wc))
        return FALSE;

	hWnd = CreateWindowEx(0,"Hidden Window", "FSMovie",0,0,0,0,0,0,0,hInstance,0);

	if (FAILED(hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)))
        return hr;
//Error Here!

	return 0;
}
CoInitializeEx undeclared indentifier. What do I have to include to make this work!!!!! For some weird reason the cutscene example compiles perfectly except when I paste the code from cutscene.cpp over into my file (complains about the same thing). Might this be something in the project settings? Thanks Talib PS I still don't understand what CoInitializeEx does, it's help wasn't too .... um, well helpfull
Try, try and fucking try again.
VolkerG
VolkerG
Perhaps you have an old version of the platform sdk? What compiler (version) are you using? Have you eventually installed the platform SDK?
Talib
Talib
Hi

I have VC6 DX9 (I think it's the one before the summer release).

Quote:

For some weird reason the cutscene example compiles perfectly except when I paste the code from cutscene.cpp over into my file (complains about the same thing). Might this be something in the project settings?


And I checked it is defined in objbase.h
Try, try and fucking try again.
IFooBar
IFooBar
try adding this before you include objbase.h?

#define _WIN32_DCOM
[size=2]aliak.net
Talib
Talib
Hi

I just discovered sorta the same thing:

In Project Settings -> Resources Tab -> Preprocessor definitions: Add WIN32

Strange.......

Created the workspace with the WIN32 Application wizard ... gotta go see if my other programs have that ... No they don't, would be kind IF THEY MENTION THAT IN THE HELPFILE!!!!!

Thanks
Talib
Try, try and fucking try again.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.