Click here to Skip to main content
15,905,914 members
Home / Discussions / COM
   

COM

 
GeneralRe: Does this COM dll look unregistered? Pin
Stephane Rodriguez.5-Dec-03 6:15
Stephane Rodriguez.5-Dec-03 6:15 
GeneralRe: Does this COM dll look unregistered? Pin
gregcost5-Dec-03 8:59
gregcost5-Dec-03 8:59 
GeneralRe: Does this COM dll look unregistered? Pin
Stephane Rodriguez.5-Dec-03 9:33
Stephane Rodriguez.5-Dec-03 9:33 
GeneralRe: Does this COM dll look unregistered? Pin
gregcost5-Dec-03 17:23
gregcost5-Dec-03 17:23 
GeneralRe: Does this COM dll look unregistered? Pin
Stephane Rodriguez.5-Dec-03 20:01
Stephane Rodriguez.5-Dec-03 20:01 
GeneralCOM event cannot emit through Wrapper Class Pin
NotProfessional4-Dec-03 9:27
NotProfessional4-Dec-03 9:27 
GeneralHelp with COMException Pin
gregcost3-Dec-03 6:00
gregcost3-Dec-03 6:00 
GeneralProblems creating new objects Pin
TobiMcNamobi2-Dec-03 23:49
TobiMcNamobi2-Dec-03 23:49 
Hi all,
I have a Windows 2000 Service that can be accessed via a COM interface. In fact I used the "DrawServ" example from the MSDN as a pattern for this. Talking to the service with this COM object works fine, like this (VB in an Excel sheet):

Dim myService As CMyServ
Set myService = New CMyServ
test = myService.getLong() 'simply returns a long

Now I tried to create a more complex method call that should return another COM object.

Dim doc As CMyDocument
doc = myService.getDocument()

For this I had to create a new type in the IDL but using the ATL wizard delivered many errors (missing header files, etc.). So I decided to make all type declarations / definitions for CMyDocument manually (IDL is appended below).

Now my first question is: Where shall I create the document object?

In VB like this?:
Dim doc As CMyDocument
Set doc = New CMyDocument
doc = myService.getDocument()

Or in the implementation of getDocument() using CoCreateInstance()?

Anyway (and I tried both ways!) whenever I'm asking for memory for a CMyDocument the appropriate call needs about 15 seconds only to tell me that "something went wrong". In Basic I get a runtime error without an error code, in VC++ I get CO_E_SERVER_EXEC_FAILURE (=0x80080005L) as a result index.

This leads me to my second question: What's wrong?

Of course all necessary registration and initialization has been done, has it? I'm checking this the whole day...

Any help is appreciated,
thanks in advance,
Tobias

Here is an excerpt (only the important lines) of my IDL:

[
object,
uuid(3CB0E4BF-675A-4d5a-BC23-440F2B92BF5A),
dual,
helpstring("IMyDocument Interface"),
pointer_default(unique)
]
interface IMyDocument : IDispatch
{
import "oaidl.idl";

[propget, id(1), helpstring("property ID")] HRESULT ID([string, out, retval] char ** pVal);
[propput, id(1), helpstring("property ID")] HRESULT ID([string, in] char * newVal);
}

[
object,
uuid(330E9E75-DF48-11CF-8E2C-00A0C90DC94B),
dual,
helpstring("IMyServ Interface"),
pointer_default(unique)
]
interface IMyServ : IDispatch
{
import "oaidl.idl";

[
id(3),
helpstring("method getLong")
]
HRESULT getLong([out,retval] long* result);
[
id(4),
helpstring("method getLastUsedDocuments")
]
HRESULT getDocument([out,retval] IMyDocument** document);
};

[
uuid(330E9E73-DF48-11CF-8E2C-00A0C90DC94B),
version(1.0),
helpstring("MyServ 1.0 Type Library")
]
library MySERVLib
{
importlib("stdole32.tlb");

[
uuid(330E9E79-DF48-11CF-8E2C-00A0C90DC94B),
helpstring("MyServ1 Class")
]
coclass CMyServ
{
[default] interface IMyServ;
};
[
uuid(554B6D8F-C8CC-487f-892D-EBF500107242),
helpstring("MyDocument Class")
]
coclass CMyDocument
{
[default] interface IMyDocument;
}

};

GeneralRe: Problems creating new objects Pin
TobiMcNamobi4-Dec-03 4:07
TobiMcNamobi4-Dec-03 4:07 
GeneralReading configuration information from a COM+ application Pin
Ivan Fernandez2-Dec-03 7:03
Ivan Fernandez2-Dec-03 7:03 
Questioncan wmi-client access the remote wmi on a machine outside of lan network? Pin
Habbit1-Dec-03 21:43
Habbit1-Dec-03 21:43 
GeneralCatching Outlook events Pin
derzellner1-Dec-03 20:02
derzellner1-Dec-03 20:02 
GeneralUse connection point in Dll. The process that load the Dll can not quit completely. Pin
chengliang1-Dec-03 19:35
chengliang1-Dec-03 19:35 
GeneralRe: Use connection point in Dll. The process that load the Dll can not quit completely. Pin
Heath Stewart4-Dec-03 10:46
protectorHeath Stewart4-Dec-03 10:46 
GeneralRe: Use connection point in Dll. The process that load the Dll can not quit completely. Pin
chengliang7-Dec-03 15:20
chengliang7-Dec-03 15:20 
GeneralRe: Use connection point in Dll. The process that load the Dll can not quit completely. Pin
Heath Stewart8-Dec-03 2:21
protectorHeath Stewart8-Dec-03 2:21 
Generalneed the header file for wsnprintf() signature Pin
derik_konark29-Nov-03 23:56
derik_konark29-Nov-03 23:56 
GeneralRe: need the header file for wsnprintf() signature Pin
Roger Stewart9-Dec-03 9:01
professionalRoger Stewart9-Dec-03 9:01 
GeneralType of Control Pane Pin
Danis Solovyov27-Nov-03 22:33
sussDanis Solovyov27-Nov-03 22:33 
GeneralDrag & Drop Pin
K-ballo27-Nov-03 15:43
K-ballo27-Nov-03 15:43 
GeneralRe: Drag & Drop Pin
Prakash Nadar27-Nov-03 16:09
Prakash Nadar27-Nov-03 16:09 
GeneralVB COM problem Pin
andyhk9527-Nov-03 15:03
andyhk9527-Nov-03 15:03 
GeneralRe: VB COM problem Pin
Brian Shifrin1-Dec-03 7:07
Brian Shifrin1-Dec-03 7:07 
GeneralRe: VB COM problem Pin
andyhk951-Dec-03 13:39
andyhk951-Dec-03 13:39 
GeneralTOM (Text Object Model) Pin
Andre123427-Nov-03 6:00
Andre123427-Nov-03 6:00 

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.