15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


OLE Server in DLL

ppbillc@srv2.sj.ablecom.net
Friday, August 16, 1996

Enviroment: Visual C++ 4.1 / Win95-WinNT 4.0

 I am trying to move an OLE server from an Exe to a DLL.

 When I try to inplace activate the server from the DLL it is missing 
the Interface IViewObject2 and Barfs? Works fin if the Server is an 
EXE.

 Anybody know if your have to do something special if your server is 
in a DLL? Dll is not an extension Dll.

TIA

Bill

 



Graham -- Cunningham@tgd.swissptt.ch
Monday, August 19, 1996

I just took a quick look at my ole dll and I have the following defined

/////////////////////////////////////////////////////////////////////////
////
// Special entry points required for inproc servers

STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	return AfxDllGetClassObject(rclsid, riid, ppv);
}

STDAPI DllCanUnloadNow(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	return AfxDllCanUnloadNow();
}

// by exporting DllRegisterServer, you can use regsvr.exe
STDAPI DllRegisterServer(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	COleObjectFactory::UpdateRegistryAll();
	return S_OK;
}

hth
Graham Cunningham
00 41 31 338 0633

>----------
>From: 	ppbillc@srv2.sj.ablecom.net[SMTP:ppbillc@srv2.sj.ablecom.net]
>Sent: 	Freitag, 16. August 1996 21:36
>To: 	mfc-l@netcom.com
>Subject: 	OLE Server in DLL
>
>Enviroment: Visual C++ 4.1 / Win95-WinNT 4.0
>
> I am trying to move an OLE server from an Exe to a DLL.
>
> When I try to inplace activate the server from the DLL it is missing 
>the Interface IViewObject2 and Barfs? Works fin if the Server is an 
>EXE.
>
> Anybody know if your have to do something special if your server is 
>in a DLL? Dll is not an extension Dll.
>
>TIA
>
>Bill
>
> 
>



ppbillc@srv2.sj.ablecom.net
Monday, August 19, 1996

> Enviroment: Visual C++ 4.1 / Win95-WinNT 4.0
> 
>  I am trying to move an OLE server from an Exe to a DLL.
> 
>  When I try to inplace activate the server from the DLL it is missing 
> the Interface IViewObject2 and Barfs? Works fin if the Server is an 
> EXE.
> 
>  Anybody know if your have to do something special if your server is 
> in a DLL? Dll is not an extension Dll.
> 
After further investigation of this problem here is what I have found.

 If you call ::OleCreate on an MFC InPlace Server (COleServer) that 
is OUTOFPROC (an exe) you get the IViewObject2 Interface. If
it is INPROC (a dll) you don't. I have searched the Knowledge base at 
microsoft.com, MSDN, newsgroups  and the OLE 2.0 Documentation.
But to no avail you guys are my last hope :( 

Bill



 




| Вернуться в корень Архива |