AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: Программирование
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 20.11.2006, 13:08   #4  
belugin is offline
belugin
Участник
Аватар для belugin
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,622 / 2925 (107) +++++++++
Регистрация: 16.01.2004
Записей в блоге: 5
Из последнего сидакса:
X++:
container internetCrackUrl(str _url, boolean _decode=false, boolean _escape=false)
{
//    typedef struct {
//      DWORD dwStructSize; 0
//      LPTSTR lpszScheme;   4
//      DWORD dwSchemeLength; 8
//      INTERNET_SCHEME nScheme; 12
//      LPTSTR lpszHostName; 16
//      DWORD dwHostNameLength; 20
//      INTERNET_PORT nPort; 24
//      LPTSTR lpszUserName; 28
//      DWORD dwUserNameLength; 32
//      LPTSTR lpszPassword; 36
//      DWORD dwPasswordLength; 40
//      LPTSTR lpszUrlPath; 44
//      DWORD dwUrlPathLength; 48
//      LPTSTR lpszExtraInfo; 52
//      DWORD dwExtraInfoLength; 56
//    } URL_COMPONENTS, 60
//
//     *LPURL_COMPONENTS;
    int maxLen = strLen(_url)+1;
    DLL             dll = new DLL('wininet.dll');
    DLLFunction     function = new DLLFunction(dll, 'InternetCrackUrlA');
    Binary          result = new Binary(60);
    Binary          cnt = new Binary(4);
    int ret;
    #define.E_POINTER(0x80004003)
//      LPTSTR lpszScheme;   4
    Binary scheme = new Binary(maxLen);
//      LPTSTR lpszHostName; 24
    Binary hostName = new Binary(maxLen);
//      LPTSTR lpszUserName; 36
    Binary userName = new Binary(maxLen);
//      LPTSTR lpszPassword; 44
    Binary password = new Binary(maxLen);
//      LPTSTR lpszUrlPath; 52
    Binary urlPath = new Binary(maxLen);
//      LPTSTR lpszExtraInfo; 60
    Binary extraInfo = new Binary(maxLen);
;
//    BOOL InternetCrackUrl(
//      LPCTSTR lpszUrl,
//      DWORD dwUrlLength,
//      DWORD dwFlags,
//      LPURL_COMPONENTS lpUrlComponents
//    );


//      DWORD dwStructSize; 0
    result.dWord(0, 60);
//      LPTSTR lpszScheme;   4
    result.binary(4, scheme);
//      DWORD dwSchemeLength; 8
    result.dWord(8, maxLen);
//      INTERNET_SCHEME nScheme; 12
//      LPTSTR lpszHostName; 16
    result.binary(16, hostName);
//      DWORD dwHostNameLength; 20
    result.dWord(20, maxLen);
//      INTERNET_PORT nPort; 24
//      LPTSTR lpszUserName; 28
    result.binary(28, userName);
//      DWORD dwUserNameLength; 32
    result.dWord(32, maxLen);
//      LPTSTR lpszPassword; 36
    result.binary(36, password);
//      DWORD dwPasswordLength; 40
    result.dWord(40, maxLen);
//      LPTSTR lpszUrlPath; 44
    result.binary(44, urlPath);
//      DWORD dwUrlPathLength; 48
    result.dWord(48, maxLen);
//      LPTSTR lpszExtraInfo; 52
    result.binary(52, extraInfo);
//      DWORD dwExtraInfoLength; 56
    result.dWord(56, maxLen);
    function.arg(ExtTypes::String, ExtTypes::DWord, ExtTypes::DWord, ExtTypes::Pointer);
    function.returns(ExtTypes::DWord);
    ret = function.call(_url, strlen(_url), (_decode ? 0x10000000 : 0) +  (_escape ? 0x080000000: 0), result);
    if (!ret)
        throw error(WinApi::formatMessage(WinApi::getLastError()));
    return [scheme.string(0), hostName.string(0), result.dWord(24), userName.string(0), password.string(0), urlPath.string(0), extrainfo.string(0)];
}
За это сообщение автора поблагодарили: Eldar9x (1).
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Типы операций в ОСах (АХ 3.0) dimit DAX: Функционал 2 17.08.2007 12:33
Типы элементов управления на форме LMA DAX: Программирование 9 05.04.2007 15:25
Типы отпусков katja DAX: Функционал 7 12.08.2005 19:59
Различные типы связей (LinkType) для FormDataSource Maxim Gorbunov DAX: База знаний и проекты 1 16.05.2004 13:20
про типы данных Valia DAX: Программирование 6 22.09.2003 12:00

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 14:05.