2010-07-21 2 views
0

내가 참조하고 문서가 여기에있다, 그리고 매우 짧고 포인트와 호환되는 C의 DLL 건물 : http://livedocs.adobe.com/en_US/Dreamweaver/9.0_API/help.html?content=dwr_sourcecontrol_so_01.html드림위버

내가으로 실행하고 문제는 내가 실제 컴파일하는 방법을 잘 오전입니다 DLL. 어도비 확장 포럼에 대한 마지막 답장은 3 개월이며,이 질문과 함께 어디로 가야할지 모르겠습니다.

저를 혼란스럽게 만드는 프로그래밍 부분은 C++로 DLL을 만들어야한다는 것입니다. 그러나 대부분의 자습서는 대상 응용 프로그램에 포함 된 헤더 파일을 기반으로 작동합니다. (저는 DLL 프로그래밍에 익숙합니다.) Dreamweaver는 DLL 만 필요로하며 호출 할 내용을 이미 알고 있습니다. DLL 파일에만이 정보를 넣을 수있는 방법에 대해 혼란 스럽지만 응용 프로그램이 헤더 파일이나 lib 파일을 필요로하기 때문에 읽은 자습서를 기반으로합니다.

VS2008을 사용하여 프로젝트 유형에 win32 DLL을 선택한 다음 내 보낸 함수 파일에서 필요한 기능을 추가했습니다. 내 첫 번째 질문은 아래와 같습니다.

extern "C" __declspec(dllexport) bool SCS_Connect(void **connectionData, const char siteName[64]) 
{ 
return true; 
} 

어떻게 작동하는지 명확히 알 수 있습니까?

편집 : 내가 말하는 통지 문서 다시 읽기 :

Dreamweaver에서는 각 API 기능에 GetProcAddress를()를 호출하여 라이브러리가 지원 기능을 결정합니다. 주소가 이 아니면 Dreamweaver는 라이브러리가 API를 지원하지 않는다고 가정합니다. 주소가 인 경우 Dreamweaver는 라이브러리 버전의 기능을 사용하여 기능을 지원합니다.

비록 이것이 내 컴파일과 관련하여 무엇을 의미하는지 잘 모르겠지만.

편집 2 : 종속성 워커 반환은 : 이들 부부는 내 DLL에 정의되어

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 소스입니다 :

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; 
} 
+1

대상 응용 프로그램에는 자동 링크 용 헤더/링크가 포함됩니다. GetProcAddress를 통한 수동 연결에는 anysuch- 임의의 DLL에서 GetProcAddress를 호출하고 함수를 찾을 필요가 없습니다. – Puppy

+0

컴파일 할 때 어떤 일이 발생합니까? 오류 메시지가 나타 납니까? – torhu

+0

컴파일에 성공합니다. 컴파일하기가 쉽다. Dreamweaver에서 함수를 올바르게 볼 수 있도록 컴파일하는 것입니다. –

답변

1

워드 프로세서에 따르면, 당신은 아마 모두를 추가해야 Dreamwaver가 DLL을 사용하기 전에 필요한 기능을 제공합니다. Dependency Walker의 프로필 모드를 사용하면 DW가 DLL을로드 할 때 어떤 일이 발생하는지 확인할 수 있습니다. 또한 DLL이 실제로 필요한 모든 기호를 내보내는 지 확인합니다.

EDIT : Dependency Walker의 모듈 트리 또는 모듈 목록에서 DLL을 선택한 다음 오른쪽의 내보내기 목록 (첫 번째 열 머리글에서 'E')을보고 필요한 모든 기능이 있는지 확인하십시오. 필수 기능 중 하나에서 GetProcessAddress가 실패하면 해당 기능을 추가해야합니다.

+0

이것은 좋은 생각입니다. 그러나 Dreamweaver에서 Dependency Walker가 호출 할 때 지연로드 종속성 모듈을 사용하고 있다고 생각합니다. API DLL의 경우 Dreamweaver에서 사이트> 새 사이트로 이동해야 오류 (로드 시도)가 실제로 발생합니다. –

+0

Ah nvm 알았어. 지금 그것을보고 ... 나는 너를 다시 업 그레 이드 할 수 있었으면 좋겠다. 이것은 매우 도움이됩니다. –

+0

방금 ​​내 답장을 편집 했으므로 여기에있는 일을 할 수있는 올바른 방법이 되길 바랍니다. – torhu

관련 문제