Jump to content
  • Advertisement
Sign in to follow this  
wxb1

[.net] help! No ATL in VC8

This topic is 4581 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

It's been a while since I've done any programming with COM in C++ but I'm wanting to play with D3D10 and VC8 express but... you can't mix unmanaged dx10 and managed c++... So I decided to try to make a COM DLL wrapper for DX10 but there is no ATL for attributes for COM... So... how do I make a COM server in VC8 express?

Share this post


Link to post
Share on other sites
Advertisement
Hmmm... I guess I should install VC7... Are there any issues with DX10 and VC7?

Share this post


Link to post
Share on other sites
I did that (download the platform SDK) but it now claims that there is no IDispatch base class....

f:\users\wxb1\documents\visual studio 2005\projects\d3dgraphics\d3dgraphics\d3dgraphics.cpp(27) : error C2504: 'IDispatch' : base class undefined
f:\users\wxb1\documents\visual studio 2005\projects\d3dgraphics\d3dgraphics\d3dgraphics.cpp(27) : error C2504: 'IDispatch' : base class undefined
f:\users\wxb1\documents\visual studio 2005\projects\d3dgraphics\d3dgraphics\d3dgraphics.cpp(34) : warning C4581: deprecated behavior: '"apartment"' replaced with 'apartment' to process attribute
f:\users\wxb1\documents\visual studio 2005\projects\d3dgraphics\d3dgraphics\d3dgraphics.cpp(41) : error C2470: 'CGraphicsManager1' : looks like a function definition, but there is no parameter list; skipping apparent body
f:\users\wxb1\documents\visual studio 2005\projects\d3dgraphics\d3dgraphics\d3dgraphics.cpp(66) : fatal error C1004: unexpected end-of-file found
Build log was saved at "file://f:\Users\wxb1\Documents\Visual Studio 2005\Projects\D3DGraphics\D3DGraphics\Debug\BuildLog.htm"
D3DGraphics - 4 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

[Edited by - wxb1 on March 5, 2006 6:39:16 PM]

Share this post


Link to post
Share on other sites
Here's the source... It just some skeleton code I decide to use since I haven't played with COM in a while:

// D3DGraphics.cpp : Defines the entry point for the DLL application.
//
#include "D3DGraphics.h"
#include "stdafx.h"


#ifdef _MANAGED
#pragma managed(push, off)
#endif

// The module attribute is specified in order to implement DllMain,
// DllRegisterServer and DllUnregisterServer
[ module(dll, name = "D3DGraphics", helpstring = "D3DGraphics Server 1.0 Type Library") ];
[ emitidl ];

/////////////////////////////////////////////////////////////////////////////
// IGraphicsManager
[
object,
uuid("103FF9D9-8BC9-4ea8-8CD4-C1E627D04358"),
dual,
helpstring("IGraphicsManager Interface"),
pointer_default(unique)
]

__interface IGraphicsManager1 : IDispatch
{
HRESULT GetANum([out, retval]int* pInt);
};
/////////////////////////////////////////////////////////////////////////////
// CObject1
[
coclass,
threading("apartment"),
vi_progid("D3DGraphics.GraphicsManager1"),
progid("D3DGraphics.GraphicsManager.1"),
version(1.0),
uuid("15615078-523C-43A0-BE6F-651E78A89213"),
helpstring("GraphicsManager1 Class")
]
class ATL_NO_VTABLE CGraphicsManager1 :
public IGraphicsManager1
{
public:
CGraphicsManager1()
{
}
HRESULT GetANum(int* pInt){
*pInt = 101;
return S_OK;
}
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}

void FinalRelease()
{
}

#ifdef _MANAGED
#pragma managed(pop)
#endif

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!