Документация, на которую я ссылаюсь, приведена здесь, и она довольно коротка, и в этом смысле: http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/help.html?content=dwr_sourcecontrol_so_01.html
Проблема, с которой я сталкиваюсь, заключается в том, что я не уверен, как скомпилировать настоящую DLL.Последнему ответу на форумах Adobe по расширению было 3 месяца, и я не уверен, куда идти с этим вопросом.
Часть программирования, которая меня смущает, заключается в том, что мне нужно собрать DLL на C ++, но большинствоучебные пособия основаны на создании заголовочного файла, который включает в себя целевое приложение.(Я новичок в программировании на DLL.) Dreamweaver нужна только DLL, и он уже знает, что он собирается вызывать.Я запутался в том, как поместить эту информацию в один файл DLL, хотя, основываясь на прочитанных мною руководствах, поскольку приложениям, похоже, также нужен заголовочный файл или файл lib.
Для первой попытки я использовал VS2008 и выбрал win32 DLL для моего типа проекта, а затем в сгенерированном экспортированном файле функций я добавил необходимые функции.Мой первый ниже:
extern "C" __declspec(dllexport) bool SCS_Connect(void **connectionData, const char siteName[64])
{
return true;
}
Может кто-нибудь помочь прояснить, как это может работать?
Редактировать: Перечитывая документацию, я заметил, что это говорит:
Dreamweaver определяет, какие функции поддерживает библиотека, вызывая GetProcAddress () для каждой функции API.Если адрес не существует, Dreamweaver предполагает, что библиотека не поддерживает API.Если адрес существует, Dreamweaver использует библиотечную версию функции для поддержки функциональности.
Хотя я все еще не уверен, что это означает в отношении моей компиляции DLL.
Редактировать 2: Возвращение зависимостей:
LoadLibraryW("c:\program files\adobe\adobe dreamweaver cs3\Configuration\SourceControl\mercFlow.dll") returned 0x05110000.
GetProcAddress(0x05110000 [MERCFLOW.DLL], "MM_InitWrapper") called from "DREAMWEAVER.EXE" at address 0x00D73D4B and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x05110000 [MERCFLOW.DLL], "SCS_GetAgentInfo") called from "DREAMWEAVER.EXE" at address 0x00D73D66 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x05110000 [MERCFLOW.DLL], "SCS_GetNumNewFeatures") called from "DREAMWEAVER.EXE" at address 0x00D73D72 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x05110000 [MERCFLOW.DLL], "SCS_GetNewFeatures") called from "DREAMWEAVER.EXE" at address 0x00D73D7E and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x05110000 [MERCFLOW.DLL], "SCS_Connect") called from "DREAMWEAVER.EXE" at address 0x00D73E2B and returned NULL. Error: The specified procedure could not be found (127).
Несколько из них определены в моей DLL (некоторые не являются обязательными в соответствии с документами), но не найдены.Означает ли это, что мои функции не экспортируются?
Вот мой источник DLL:
dllheader.h
#ifndef DLLHEADER_H_INCLUDED
#define DLLHEADER_H_INCLUDED
#ifdef DLL_EXPORT
# define EXPORT extern "C" __declspec (dllexport)
#else
# define EXPORT
#endif
DLL_EXPORT struct itemInfo;
DLL_EXPORT bool SCS_GetAgentInfo(char name[32],char version[32], char description[256], const char * dwAppVersion);
DLL_EXPORT bool SCS_Connect(void **connectionData, const char siteName[64]);
DLL_EXPORT bool SCS_Disconnect(void *connectionData);
DLL_EXPORT bool SCS_IsConnected(void *connectionData);
DLL_EXPORT int SCS_GetRootFolder_Length(void *connectionData);
DLL_EXPORT int SCS_GetFolderListLength(void *connectionData, const char *remotePath);
DLL_EXPORT bool SCS_GetFolderList(void *connectionData, const char *remotePath, itemInfo itemList[ ], const int numItems);
DLL_EXPORT bool SCS_Get(void *connectionData, const char *remotePathList[], const char *localPathList[], const int numItems);
DLL_EXPORT bool SCS_Put(void *connectionData, const char *localPathList[], const char *remotePathList[], const int numItems);
DLL_EXPORT bool SCS_NewFolder(void *connectionData,const char *remotePath);
DLL_EXPORT bool SCS_Delete(void *connectionData, const char *remotePathList[],const int numItems);
DLL_EXPORT bool SCS_Rename(void *connectionData, const char * oldRemotePath, const char*newRemotePath);
DLL_EXPORT bool SCS_ItemExists(void *connectionData,const char *remotePath);
#endif
main.cpp
#define DLL_EXPORT
#include "dllheader.h"
#include <iostream>
char* const gName="MercFlow";
char* const gVersion="1.0";
char* const gDescription="Native Mercurial Support for Dreamweaver.";
DLL_EXPORT struct itemInfo
{
bool isFolder;
int month;
int day;
int year;
int hour;
int minutes;
int seconds;
char type[256];
int size;
};
// Description: This function asks the DLL to return its name and description, which appear in the Edit Sites dialog box. The name appears in the Server Access pop-up menu (for example, sourcesafe, webdav, perforce) and the description below the pop-up menu.
// name: The name argument is the name of the source control system. The name appears in the combo box for selecting a source control system on the Source Control tab in the Edit Sites dialog box. The name can be a maximum of 32 characters.
DLL_EXPORT bool SCS_GetAgentInfo(char name[32],char version[32], char description[256], const char * dwAppVersion)
{
name=gName;
version=gVersion;
description=gDescription;
return true;
}
//Description: This function connects the user to the source control system. If the DLL does not have log-in information, the DLL must display a dialog box to prompt the user for the information and must store the data for later use.
DLL_EXPORT bool SCS_Connect(void **connectionData, const char siteName[64])
{
return true;
}
DLL_EXPORT bool SCS_Disconnect(void *connectionData)
{
return true;
}
DLL_EXPORT bool SCS_IsConnected(void *connectionData)
{
return true;
}
DLL_EXPORT int SCS_GetRootFolder_Length(void *connectionData)
{
return 0;
}
DLL_EXPORT bool SCS_GetRootFolder(void *connectionData, char remotePath[],const int folderLen)
{
return true;
}
DLL_EXPORT int SCS_GetFolderListLength(void *connectionData, const char *remotePath)
{
return 0;
}
DLL_EXPORT bool SCS_GetFolderList(void *connectionData, const char *remotePath, itemInfo itemList[ ], const int numItems)
{
return true;
}
DLL_EXPORT bool SCS_Get(void *connectionData, const char *remotePathList[], const char *localPathList[], const int numItems)
{
return true;
}
DLL_EXPORT bool SCS_Put(void *connectionData, const char *localPathList[], const char *remotePathList[], const int numItems)
{
return true;
}
DLL_EXPORT bool SCS_NewFolder(void *connectionData,const char *remotePath)
{
return true;
}
DLL_EXPORT bool SCS_Delete(void *connectionData, const char *remotePathList[],const int numItems)
{
return true;
}
DLL_EXPORT bool SCS_Rename(void *connectionData, const char * oldRemotePath, const char*newRemotePath)
{
return true;
}
DLL_EXPORT bool SCS_ItemExists(void *connectionData,const char *remotePath)
{
return true;
}