Click here to Skip to main content
16,008,490 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 18:49
ThatsAlok22-Dec-05 18:49 
GeneralRe: Linker problem Pin
S. Senthil Kumar22-Dec-05 19:12
S. Senthil Kumar22-Dec-05 19:12 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 19:43
ThatsAlok22-Dec-05 19:43 
GeneralRe: Linker problem Pin
ThatsAlok22-Dec-05 21:33
ThatsAlok22-Dec-05 21:33 
QuestionCOM in C language. Pin
pc_dev22-Dec-05 1:07
pc_dev22-Dec-05 1:07 
AnswerRe: COM in C language. Pin
Cedric Moonen22-Dec-05 1:53
Cedric Moonen22-Dec-05 1:53 
GeneralRe: COM in C language. Pin
pc_dev22-Dec-05 19:51
pc_dev22-Dec-05 19:51 
AnswerRe: COM in C language. Pin
Andy Moore22-Dec-05 6:44
Andy Moore22-Dec-05 6:44 
Yes you can. Here is an example calling Microsoft's DirectX diagnostic utilities. The
interface IDxDiagProvider is a C++ class or a C structure. Here it is a C structure and the V-Table methods are called through the lpVtbl structure of function pointers. Also the pointer to the object it self is passed into the first parameter since there is no "this" pointer.

HRESULT hr;<br />
	BOOL bCleanupCOM = FALSE;<br />
	IDxDiagProvider* pDxDiagProvider = NULL;<br />
	DXDIAG_INIT_PARAMS dxDiagInitParams;<br />
	VARIANT var;<br />
	char strDestination[10];<br />
<br />
	hr = CoInitialize( NULL );<br />
<br />
	bCleanupCOM = SUCCEEDED( hr );<br />
<br />
	hr = CoCreateInstance( &CLSID_DxDiagProvider, NULL, CLSCTX_INPROC_SERVER,<br />
		                   &IID_IDxDiagProvider, (void**)&pDxDiagProvider );<br />
<br />
	if( SUCCEEDED( hr ) )<br />
	{<br />
		ZeroMemory( &dxDiagInitParams, sizeof( DXDIAG_INIT_PARAMS ) );<br />
<br />
		dxDiagInitParams.dwSize = sizeof( DXDIAG_INIT_PARAMS );<br />
		dxDiagInitParams.dwDxDiagHeaderVersion = DXDIAG_DX9_SDK_VERSION;<br />
		dxDiagInitParams.bAllowWHQLChecks = FALSE;<br />
		dxDiagInitParams.pReserved = NULL;<br />
<br />
		hr = pDxDiagProvider->lpVtbl->Initialize( pDxDiagProvider, &dxDiagInitParams );



I hope this helps.

Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
GeneralRe: COM in C language. Pin
pc_dev22-Dec-05 19:53
pc_dev22-Dec-05 19:53 
QuestionUsing a mask for drawing non rectangular bitmaps Pin
Ward22-Dec-05 0:36
Ward22-Dec-05 0:36 
AnswerRe: Using a mask for drawing non rectangular bitmaps Pin
PJ Arends22-Dec-05 8:43
professionalPJ Arends22-Dec-05 8:43 
AnswerRe: Using a mask for drawing non rectangular bitmaps Pin
Ward25-Dec-05 10:08
Ward25-Dec-05 10:08 
QuestionGetMenu() returns NULL for Visual Studio 2003 Pin
Owner drawn22-Dec-05 0:29
Owner drawn22-Dec-05 0:29 
Question_tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:16
Nishad S22-Dec-05 0:16 
AnswerRe: _tcscpy Vs lstrcpy Pin
toxcct22-Dec-05 0:31
toxcct22-Dec-05 0:31 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:43
Nishad S22-Dec-05 0:43 
GeneralRe: _tcscpy Vs lstrcpy Pin
Blake Miller22-Dec-05 5:41
Blake Miller22-Dec-05 5:41 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 16:23
Nishad S22-Dec-05 16:23 
AnswerRe: _tcscpy Vs lstrcpy Pin
ThatsAlok22-Dec-05 0:53
ThatsAlok22-Dec-05 0:53 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 0:56
Nishad S22-Dec-05 0:56 
AnswerRe: _tcscpy Vs lstrcpy Pin
Aamir Butt22-Dec-05 18:58
Aamir Butt22-Dec-05 18:58 
GeneralRe: _tcscpy Vs lstrcpy Pin
Nishad S22-Dec-05 19:01
Nishad S22-Dec-05 19:01 
Questiontemplate with Iterator - some Problems Pin
tbrake22-Dec-05 0:08
tbrake22-Dec-05 0:08 
AnswerRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 0:47
Sebastian Schneider22-Dec-05 0:47 
GeneralRe: template with Iterator - some Problems Pin
tbrake22-Dec-05 0:57
tbrake22-Dec-05 0:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.