Передача массива структур в VC.Net
От: serge_ Украина  
Дата: 05.09.03 13:51
Оценка:
Простите может повторюсь неоднократно, но то что раньше писалось почему то не работает,
при компиляции выдаёт ошибки:

...\vc\mail\mailserver\mserver.h(36): error MIDL2025 : syntax error : expecting a type specification near "cJustUser"
...\vc\mail\mailserver\mserver.h(36): error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
MailServer fatal error LNK1240: failed to compile IDL content

Что неправильно в моём коде?


#pragma once
#include "resource.h" // main symbols
#include <atlsimpcoll.h>



[uuid(153450BE-9F71-4193-9A00-95C58175FD8F)]
struct cJustUser {
CHAR m_szFirstName[16];
CHAR m_szLastName[16];
CHAR m_szMailAsdress[64];
CHAR m_szPhone[16];
CHAR m_szAddress[64];
SHORT m_nPermission;

}cJustUser;


// IMServer
[
object,
uuid("FE45D72B-465A-4B2D-A7BE-1349EBDEBB0E"),
dual, helpstring("IMServer Interface"),
pointer_default(unique)
]
__interface IMServer : IDispatch
{
[id(1), helpstring("method GetMail")] HRESULT GetMail([in] VARIANT* pVal);
[id(2), helpstring("method SendMail")] HRESULT SendMail([in] VARIANT* pVal);
[id(3), helpstring("method AddUser")] HRESULT AddUser([in, satype(struct cJustUser)] SAFEARRAY * pVal);
};


// _IMServerEvents
[
dispinterface,
uuid("D5B520C9-0A44-41C7-97E7-CFB47DFCD872"),
helpstring("_IMServerEvents Interface")
]
__interface _IMServerEvents
{
};


// CMServer

[
coclass,
threading("apartment"),
support_error_info("IMServer"),
event_source("com"),
aggregatable("never"),
vi_progid("MailServer.MServer"),
progid("MailServer.MServer.1"),
version(1.0),
uuid("E682D15C-D865-4249-AB7A-6351F434BC7E"),
helpstring("MServer Class")
]


class ATL_NO_VTABLE CMServer :
public IMServer
{
public:
CMServer()
{
}

__event __interface _IMServerEvents;

DECLARE_PROTECT_FINAL_CONSTRUCT()

HRESULT FinalConstruct()
{
return S_OK;
}

void FinalRelease()
{
}

public:

STDMETHOD(GetMail)(VARIANT* pVal);
STDMETHOD(SendMail)(VARIANT* pVal);
protected:
//CSimpleArray<cUser> m_Users;
public:

STDMETHOD(AddUser)(SAFEARRAY * pVal);
};



struct cMessage
{

char m_szTo[256];
char m_szFrom[256];
char m_szRecipient[256];
char m_szSender[256];
int m_nSize;



};
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.