Re: EuCOM 2.08 + WinXP Pro SP3

new topic     » goto parent     » topic index » view thread      » older message » newer message
Rad said...

Please can anybody guide me regarding incorporating relevant EuCOM functions in the existing code?

Sorry, I started to see if I could whip something up for you, but got stuck when I was trying to read typelib info using tbrowse (I don't really have a 3.1 environment anymore, and it's having fits working with 4.0 and my include path, apparently). Here's what I did so far, following what I mentioned previously:

constant 
	CoGetClassObject = define_c_func( ole32, "CoGetClassObject",  
		{C_POINTER, C_INT, C_POINTER, C_POINTER, C_POINTER }) 
		 
 
global constant 
  CLSCTX_INPROC_SERVER            = #1, 
  CLSCTX_INPROC_HANDLER           = #2, 
  CLSCTX_LOCAL_SERVER             = #4, 
  CLSCTX_INPROC_SERVER16          = #8, 
  CLSCTX_REMOTE_SERVER            = #10, 
  CLSCTX_INPROC_HANDLER16         = #20, 
  CLSCTX_RESERVED1                = #40, 
  CLSCTX_RESERVED2                = #80, 
  CLSCTX_RESERVED3                = #100, 
  CLSCTX_RESERVED4                = #200, 
  CLSCTX_NO_CODE_DOWNLOAD         = #400, 
  CLSCTX_RESERVED5                = #800, 
  CLSCTX_NO_CUSTOM_MARSHAL        = #1000, 
  CLSCTX_ENABLE_CODE_DOWNLOAD     = #2000, 
  CLSCTX_NO_FAILURE_LOG           = #4000, 
  CLSCTX_DISABLE_AAA              = #8000, 
  CLSCTX_ENABLE_AAA               = #10000, 
  CLSCTX_FROM_DEFAULT_CONTEXT     = #20000, 
  CLSCTX_ACTIVATE_32_BIT_SERVER   = #40000, 
  CLSCTX_ACTIVATE_64_BIT_SERVER   = #80000, 
  CLSCTX_ENABLE_CLOAKING          = #100000, 
  CLSCTX_PS_DLL                   = #80000000  
	 
function get_class_object( integer clsid_ix, atom dwClsContext, atom pServerInfo, integer iid ) 
	atom mset, ppv, rclsid, riid, ok 
	atom pclass 
	 
	mset = w32new_memset() 
	ppv = w32acquire_mem( mset, 4 ) 
	rclsid = w32acquire_mem( mset, clsid_table[CLSID_BYTES][clsid_ix] ) 
	riid = w32acquire_mem( mset, iid_table[IID_BYTES][iid] ) 
	 
	ok = c_func( CoGetClassObject, { rclsid, dwClsContext, pServerInfo, riid, ppv }) 
	if ok then 
		err:print_com_error( sprintf( "CoGetclassOjbect Error: %x\n",ok)) 
		err:com_error( ok ) 
		pclass = 0 
	else 
		pclass = peek4u( ppv ) 
	end if 
	w32release_mem( mset ) 
	return pclass 
end function 
 

The get_class_object() function is obviously just a start. I needed to get the details on the IClassInfo and IClassInfo2 (or whatever they are...) interfaces before I could proceed with actually creating the object using the registration data.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu