Желаю Вам всего наилучшего, All.Дмитрий
�� A�� 26 2009 22:43 �� ����������y �p�����
Dmytry Ginzburg ������� � All:
DG> ����� �� ���������������. ��� ���� ��� ���? � ���� �� �������?
H� ����������� � �������� ��������������� ���� (MFC/ATL). �������� ����� :) ���
������� ��������� �� �������� (���� � ��������). ����������� VC.
H� ����, Dmytry.
���-��, �������, ��� 05 2009, � 00:17, Vlad Foltz ������� � Dmytry Ginzburg ��
����� ��������, �� ��� ���ң� _"���� ATL 3.0 � �++ Builder 6.0"_
VF> �� A�� 26 2009 22:43 �� ����������y �p�����
VF> Dmytry Ginzburg ������� � All:
DG>> ����� �� ���������������. ��� ���� ��� ���? � ���� �� �������?
VF> H� ����������� � �������� ��������������� ���� (MFC/ATL). �������� �����
VF> :) ��� ������� ��������� �� �������� (���� � ��������). ����������� VC.
��� MFC ������� �� ����. � ��� COM-������ ��� ATL �� ������� �� �������. ��� �
������ ��� ��������� ������������, � �������, ������� ���������(�) ��������� ��
�����? ����� ���� �� ������� ����������, �� � �� ��̣� � ���, ��� ���� � ������
���������� ��� COM-�������, ����� ��� ��������� ������ �������. � � ������ ��
COM �� ���� ����� ����� �� �������.
����� ��� ����� ����������, Vlad.�������.
�� Ma� 05 2009 22:21 �� ����������y �p�����
Dmytry Ginzburg ������� � Vlad Foltz:
DG> ��� MFC ������� �� ����. � ��� COM-������ ��� ATL �� ������� ��
DG> �������.
H� ����� - ������. ��� ���� ���������. ATL � ������� �� ������� ����������, ���
"���������" - �� ����� ��� ������������� �����. �������-�� ��� ����� � ����
����� ��� ��� � ������������. ��� �����-�� ������� ���� ���� CComBSTR �
������...
DG> ��� � ������ ��� ��������� ������������, � �������, �������
DG> ���������(�) ��������� �� �����? ����� ���� �� ������� ����������, ��
DG> � �� ��̣� � ���, ��� ���� � ������ ���������� ��� COM-�������, �����
DG> ��� ��������� ������ �������. � � ������ �� COM �� ���� ����� ����� ��
DG> �������.
MSDN. ��� ��� ����. ����������� ��� ����� ��������, ���� � COM ����������
��������.
H� ����, Dmytry.
���-��, �������, ��� 05 2009, � 20:57, Vlad Foltz ������� � Dmytry Ginzburg ��
����� ��������, �� ��� ���ң� _"���� ATL 3.0 � �++ Builder 6.0"_
VF> �p����, Dmytry !
VF> �� Ma� 05 2009 22:21 �� ����������y �p�����
VF> Dmytry Ginzburg ������� � Vlad Foltz:
DG>> ��� MFC ������� �� ����. � ��� COM-������ ��� ATL �� ������� ��
DG>> �������.
VF> H� ����� - ������. ��� ���� ���������. ATL � ������� �� �������
VF> ����������, ��� "���������" - �� ����� ��� ������������� �����. �������-��
VF> ��� ����� � ���� ����� ��� ��� � ������������. ��� �����-�� ������� ����
VF> ���� CComBSTR � ������...
H�, ������ ������������ �������������, ����� ������������ ����� VARIANT. � ���
� ������������ ������������� ���������� �������� ����������. � �����, ��� �
����� � ���� ��� �����������. ���������, ��������� � ����� ������ ATL. ������ �
������ ���������� ������ � ���������� VCL. �������� � ���� RemoteDataModule.
����� ����� ��� ������ ������ ���������� �����, ��������������� h � cpp �����,
� ����� ���� � ����������� bpf. ���� ���� ����� ��������� ���������.
_!--==> � ���� Windows Clipboard ����������... <==--!_
#include <atl\atlmod.h>
#include "MyServerImpl.h"
USEFORM("MyServerImpl.cpp", MyServer); /* TCRemoteDataModule: File Type */ /*
MyServer: CoClass */
//---------------------------------------------------------------------------
This file is used by the project manager only and should be treated like the
project file
// NOTE: You may derive a class from TComModule and use it as your server's
// module object. (i.e. Assign an instance of that class to _Module).
// However, you must *NOT* change the name _Module.
//
TComModule _ProjectModule(0 /*InitATLServer*/);
TComModule &_Module = _ProjectModule;
// The ATL Object map holds an array of _ATL_OBJMAP_ENTRY structures that
// described the objects of your OLE server. The MAP is handed to your
// project's CComModule-derived _Module object via the Init method.
//
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_MyServer, TMyServerImpl)
END_OBJECT_MAP()
//---------------------------------------------------------------------------
_!--==> � ���� Windows Clipboard �������������... <==--!_
��� � �������, ���������� ����� ����� ����������� ����� ������ � �������
WinMain �������� ������ ���������. � � ��������� ������ ���� TComModule.
������� ����� ���������� ATL, � ������, ��� ��� ���� �����, �������
������������ ������ � �������, ���� ��� ����������, � ����� ������������
������� ������. ���� ����� ���������� �� Initproc, ������������� �� ������
������������� ����������� �ݣ �� ������ WinMain. � ��� ������ RemoteDataModule
��������� ��� ������ CreateInstance ������� ������. � ����� ����� ���������
������ tmFree. �����, ��� � �������, ��� ��������� � ����� ������� �������
���������� ������� COM ������� �����, � ������� � ���� ������. ��� ����������
���������� ������� �� ���� RemoteDataModule ��������� �� ������ ������ �
��������. ����� ��������� event.
_!--==> � ���� Windows Clipboard ����������... <==--!_
HANDLE hEvent=CreateEvent(0,true,false,0);
_!--==> � ���� Windows Clipboard �������������... <==--!_
� ����������� ����� ������� � ��� ������������
_!--==> � ���� Windows Clipboard ����������... <==--!_
void __fastcall TMyServer::CRemoteDataModuleDestroy(TObject *Sender)
{SetEvent(hEvent);
}
_!--==> � ���� Windows Clipboard �������������... <==--!_
� ����� � WinMain ��� �������� ������ ��������� ������� �������� ������������
�������
_!--==> � ���� Windows Clipboard ����������... <==--!_
WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
int nCmdShow)
{if(!strstr(lpCmdLine,"regserver")&&(!strstr(lpCmdLine,"unregserver")))WaitForS
ingleObject(hEvent,INFINITE);
return 0;
}
_!--==> � ���� Windows Clipboard �������������... <==--!_
������ ������ � ����������� �������. � ����� ����������� ������ ���������� ��
���� � ��������, ��� ���������� ������, ��� ������� ������� �� ������������ �
������. ��� ���� ������� ������ ����� �����, ������� ������ ���������� ���
�����������
_!--==> � ���� Windows Clipboard ����������... <==--!_
static HRESULT WINAPI UpdateRegistry(BOOL bRegister)
{
TRemoteDataModuleRegistrar regObj(GetObjectCLSID(), GetProgID(),
GetDescription());
// Disable these flags in order to disable use by socket or web
connections.
// Also set other flags to configure the behavior of your application
server.
// For more information, see atlmod.h and atlvcl.cpp.
regObj.Singleton = true;
regObj.EnableWeb = true;
regObj.EnableSocket = true;
return regObj.UpdateRegistry(bRegister);
}
_!--==> � ���� Windows Clipboard �������������... <==--!_
� ��������� ��������� ���������� �� ���� ������, � ����� �� ������������� ����
�������, �� ��� ������� � ������ /regserver �� ����� ��� ���������� ������-��
����������. ������������ �������� ��������� - ��� ��������� �� ������� WinMain.
� ��� ��� ���� ������� ��������, �.�. � �������� ����������� ����. ��� �����
�ϣ ��������� ������ ������ ATL ������ ���������� � ���, ��� ��� �
���������������� �������� ��� ������ ��������. � ��� ��������� ������, ���
����� �� ������ ������ ���� ����������, ���� ���� ����� � ��� �������� ��
Visual Studio, ���� ����� ������� ������ ����������� VCL, ������� ������ �����
���� �� ��������� � ������������� ATL, ���� �� �ӣ �������� ���, ��� ����.
DG>> ��� � ������ ��� ��������� ������������, � �������, �������
DG>> ���������(�) ��������� �� �����? ����� ���� �� ������� ����������, ��
DG>> � �� ��̣� � ���, ��� ���� � ������ ���������� ��� COM-�������, �����
DG>> ��� ��������� ������ �������. � � ������ �� COM �� ���� ����� ����� ��
DG>> �������.
VF> MSDN. ��� ��� ����. ����������� ��� ����� ��������, ���� � COM ����������
VF> ��������.
� ���������, �� ����� ���������� ATL ��� ����� ��� ����������, � ���� ���������
���������� ������� ��������.
����� ��� ����� ����������, Vlad.�������.
�� Ma� 07 2009 23:26 �� ����������y �p�����
Dmytry Ginzburg ������� � Vlad Foltz:
VF>> �����-�� ������� ���� ���� CComBSTR � ������...
DG> H�, ������ ������������ �������������, ����� ������������ �����
DG> VARIANT.
����� ����� ����. ������ ��� ���� ���� ������� � ���, ��� � "����" ��� "Borland
ATL" ����� �� �����. ������� ��� �������. �� ������ ������� �� ����? ���� �
���� :) ������ ��� �� ������� ���� �� �� �������� ������ COM �� �� ��������
ATL.
[-=���-���=-]
DG> � ���������, �� ����� ���������� ATL ��� ����� ��� ����������,
��� ��� ���� :) � ��� ����� � ��� ����������� COM-�����������. ������ �� ������
�������. ������ ����� ������ �� � MSDN, � � �����-������ ������, ���� "������
COM".
P.S. � ����� ���������� ������ ����� �� ���� ������. ����� ��� �� ��������� ��
� ��������, �� � ATL. ���� ��� �������� � ����������� � ���� ������ �������
"���� ���-��", �� ������� ��� ����������� ������� � ������.
H� ����, Dmytry.