IDL problems: expecting a type specification near ...

1008 views
Skip to first unread message

David Valera

unread,
Oct 16, 2001, 7:25:56 AM10/16/01
to
Hello,

I am quite new to C++ programming and IDL, sop hopefully someone here
can point me in the right direction.

In IDL, I get an error when compiling the following:

[id(1), helpstring("method SendFileToClient")] HRESULT SendFileToClient(
[in] EXTENSION_CONTROL_BLOCK * pecb,
[in] BSTR bstrFilename
);

saying: error MIDL2025 : syntax error : expecting a type specification
near "EXTENSION_CONTROL_BLOCK"

I have tried declaring the EXTENSION_CONTROL_BLOCK structure in the IDL,
but that did not help.

Does anyone have a clue or point me at least in the right direction?

TIA,

--
David Valera

Neil Groves

unread,
Oct 18, 2001, 9:27:43 PM10/18/01
to
You were correct in trying to define EXTENSION_CONTROL_BLOCK before the
problematic method. Keep trying... once it is declared appropriately it
will compile.

While this reponse is not going to give you the solution, I hope you know
where to look. If you would like further help perhaps you could post more
of the code?

Regards,
Neil Groves
Irrational Dafodil Ltd
"David Valera" <da...@altavista.nl> wrote in message
news:MPG.163637a24...@msnews.microsoft.com...

David Valera

unread,
Oct 19, 2001, 7:15:15 AM10/19/01
to
Neil Groves says...

> You were correct in trying to define EXTENSION_CONTROL_BLOCK before the
> problematic method. Keep trying... once it is declared appropriately it
> will compile.

The questions is, how to correctly declare this EXTENSION_CONTROL_BLOCK
in IDL. I have the following declared:

import "oaidl.idl";
import "ocidl.idl";

typedef BYTE far *LPBYTE;
#define HSE_LOG_BUFFER_LEN 80
typedef LPVOID HCONN;

typedef struct _EXTENSION_CONTROL_BLOCK {
DWORD cbSize; // Size of this structure.
DWORD dwVersion; // Version info of this specification.
HCONN ConnID; // Context number not to be modified!
DWORD dwHttpStatusCode; // HTTP Status code.
CHAR lpszLogData[HSE_LOG_BUFFER_LEN]; // Null-terminated log info.
LPSTR lpszMethod; // REQUEST_METHOD
LPSTR lpszQueryString; // QUERY_STRING
LPSTR lpszPathInfo; // PATH_INFO
LPSTR lpszPathTranslated; // PATH_TRANSLATED
DWORD cbTotalBytes; // Total bytes indicated from client.
DWORD cbAvailable; // Available number of bytes.
LPBYTE lpbData; // Pointer to cbAvailable bytes.
LPSTR lpszContentType; // Content type of client data.
} EXTENSION_CONTROL_BLOCK;

[
object,
uuid(32C6A7CF-B13F-4ba0-86B0-C546EEEA6208),
dual,
helpstring("IUniTest Interface"),
pointer_default(unique)
]
interface IUniTest : IDispatch
{
[id(1), helpstring("...")] HRESULT SendFileToClient(


[in] EXTENSION_CONTROL_BLOCK * pecb,
[in] BSTR bstrFilename
);

};

[
uuid(A0698668-6935-4906-948C-6EB322AC8214),
version(1.0),
helpstring("Test 1.0 Type Library")
]
library TestLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");

[
uuid(CB994E2E-F1C5-4f79-91C7-0B97832AFB4B),
helpstring("Test Class")
]
coclass WebDavExt
{
[default] interface IUniTest;
};
};


> While this reponse is not going to give you the solution, I hope you know
> where to look. If you would like further help perhaps you could post more
> of the code?

Whatever I do I keep getting error MIDL2139 : type of the parameter
cannot derive from void or void * : [ Type 'LPVOID' ( Parameter 'pecb' )
]

Any ideas would be helpfull

--
David Valera

y2jc...@gmail.com

unread,
Mar 2, 2016, 7:17:13 AM3/2/16
to
if change your idl declaration of the method to this:
[id(1), helpstring("...")] HRESULT SendFileToClient(


[in] struct EXTENSION_CONTROL_BLOCK * pecb,
[in] BSTR bstrFilename
);

it should hoepefully work ,cause midl compiler is looking for the typespecification of the parameter ur passing .

Reply all
Reply to author
Forward
0 new messages