digitalmars.D.learn - setting IE options
- Tyro[a.c.edwards] (49/49) Dec 04 2007 I'm looking for some guidance on how to Internet Explorer options using ...
- Tyro[a.c.edwards] (6/66) Dec 05 2007 I located wininet.dll and build from it a .lib file using implib. Howeve...
- Bill Baxter (18/29) Dec 05 2007 You need to use the /system flag with implib.
- Tyro[a.c.edwards] (2/35) Dec 05 2007 Thanks, I have tried both /i, /noi, /system, combinations, and now switc...
- Bill Baxter (10/46) Dec 05 2007 Ah, ok. Check dependency walker or dumbpin /exports.
- Tyro[a.c.edwards] (2/54) Dec 05 2007 Unfortunately, that doesn't work either. I've used both options and gott...
- Bill Baxter (4/58) Dec 05 2007 Did you use extern(Windows) or extern(System) when you declared the
- Tyro[a.c.edwards] (2/62) Dec 05 2007 Initially I used extern(Windows) but I just tried extern(System) and got...
I'm looking for some guidance on how to Internet Explorer options using functionality available in D. I am trying to make the following work but cannot since I don't have a copy of wininet.lib: import std.c.windows.windows; extern(Windows){ alias HANDLE HINTERNET; struct INTERNET_PER_CONN_OPTION { DWORD dwOption; //union Value { DWORD dwValue; LPTSTR pszValue; FILETIME ftValue; } ; // Does not work union { DWORD dwValue; LPTSTR pszValue; FILETIME ftValue; } ; // hopefully that does the trick } alias INTERNET_PER_CONN_OPTION* LPINTERNET_PER_CONN_OPTION; struct INTERNET_PER_CONN_OPTION_LIST { DWORD dwSize; LPTSTR pszConnection; DWORD dwOptionCount; DWORD dwOptionError; LPINTERNET_PER_CONN_OPTION pOptions; } alias INTERNET_PER_CONN_OPTION_LIST* LPINTERNET_PER_CONN_OPTION_LIST; enum { INTERNET_PER_CONN_PROXY_SERVER = 2, INTERNET_OPTION_PER_CONNECTION_OPTION = 75 } bool InternetSetOption( HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength ); } int main(char[][] args) { INTERNET_PER_CONN_OPTION_LIST List; INTERNET_PER_CONN_OPTION Option[1]; ulong nSize = INTERNET_PER_CONN_OPTION_LIST.sizeof; Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER; //Option[0].Value.pszValue = "http://myproxy:8080"; Option[0].pszValue = "http://myproxy:8080"; // Is that even legal? List.dwSize = INTERNET_PER_CONN_OPTION_LIST.sizeof; List.pszConnection = null; List.dwOptionCount = 1; List.dwOptionError = 0; List.pOptions = &Option[0]; if(!InternetSetOption(null, INTERNET_OPTION_PER_CONNECTION_OPTION, &List, nSize)) printf("InternetQueryOption failed! (%d)\n", GetLastError()); return 0; } Thanks, Andrew
Dec 04 2007
Tyro[a.c.edwards] Wrote:I'm looking for some guidance on how to Internet Explorer options using functionality available in D. I am trying to make the following work but cannot since I don't have a copy of wininet.lib:I located wininet.dll and build from it a .lib file using implib. However when attempting to compile the program the following error occurs: Error 42: Symbol Undefined _InternetSetOption --- errorlevel 1 Is there something I am missing? Any advice is appreciated.import std.c.windows.windows; extern(Windows){ alias HANDLE HINTERNET; struct INTERNET_PER_CONN_OPTION { DWORD dwOption; //union Value { DWORD dwValue; LPTSTR pszValue; FILETIME ftValue; } ; // Does not work union { DWORD dwValue; LPTSTR pszValue; FILETIME ftValue; } ; // hopefully that does the trick } alias INTERNET_PER_CONN_OPTION* LPINTERNET_PER_CONN_OPTION; struct INTERNET_PER_CONN_OPTION_LIST { DWORD dwSize; LPTSTR pszConnection; DWORD dwOptionCount; DWORD dwOptionError; LPINTERNET_PER_CONN_OPTION pOptions; } alias INTERNET_PER_CONN_OPTION_LIST* LPINTERNET_PER_CONN_OPTION_LIST; enum { INTERNET_PER_CONN_PROXY_SERVER = 2, INTERNET_OPTION_PER_CONNECTION_OPTION = 75 } bool InternetSetOption( HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength ); } int main(char[][] args) { INTERNET_PER_CONN_OPTION_LIST List; INTERNET_PER_CONN_OPTION Option[1]; ulong nSize = INTERNET_PER_CONN_OPTION_LIST.sizeof; Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER; //Option[0].Value.pszValue = "http://myproxy:8080"; Option[0].pszValue = "http://myproxy:8080"; // Is that even legal? List.dwSize = INTERNET_PER_CONN_OPTION_LIST.sizeof; List.pszConnection = null; List.dwOptionCount = 1; List.dwOptionError = 0; List.pOptions = &Option[0]; if(!InternetSetOption(null, INTERNET_OPTION_PER_CONNECTION_OPTION, &List, nSize)) printf("InternetQueryOption failed! (%d)\n", GetLastError()); return 0; } Thanks, Andrew
Dec 05 2007
Tyro[a.c.edwards] wrote:Tyro[a.c.edwards] Wrote:You need to use the /system flag with implib. f:\usr\pkg\d>implib /h Digital Mars Import Library Manager Version 7.6B1n Copyright (C) Digital Mars 2000. All Rights Reserved. Usage: IMPLIB [switches] implibname.lib [ file.dll | file.def ] switches: /? Print this message /b Batch /h Print this message /i Ignore case of symbols /noi Be case sensitive. Mark library as case sensitive /nowep Ignore WEP /p:number Set page size to number (a power of 2) /system Prepend '_' to exported internal names (NT system DLL) ---bbI'm looking for some guidance on how to Internet Explorer options using functionality available in D. I am trying to make the following work but cannot since I don't have a copy of wininet.lib:I located wininet.dll and build from it a .lib file using implib. However when attempting to compile the program the following error occurs: Error 42: Symbol Undefined _InternetSetOption --- errorlevel 1 Is there something I am missing? Any advice is appreciated.
Dec 05 2007
Bill Baxter Wrote:Tyro[a.c.edwards] wrote:Thanks, I have tried both /i, /noi, /system, combinations, and now switch. However, no attempt thus far has produced the desired result.Tyro[a.c.edwards] Wrote:You need to use the /system flag with implib. f:\usr\pkg\d>implib /h Digital Mars Import Library Manager Version 7.6B1n Copyright (C) Digital Mars 2000. All Rights Reserved. Usage: IMPLIB [switches] implibname.lib [ file.dll | file.def ] switches: /? Print this message /b Batch /h Print this message /i Ignore case of symbols /noi Be case sensitive. Mark library as case sensitive /nowep Ignore WEP /p:number Set page size to number (a power of 2) /system Prepend '_' to exported internal names (NT system DLL) ---bbI'm looking for some guidance on how to Internet Explorer options using functionality available in D. I am trying to make the following work but cannot since I don't have a copy of wininet.lib:I located wininet.dll and build from it a .lib file using implib. However when attempting to compile the program the following error occurs: Error 42: Symbol Undefined _InternetSetOption --- errorlevel 1 Is there something I am missing? Any advice is appreciated.
Dec 05 2007
Tyro[a.c.edwards] wrote:Bill Baxter Wrote:Ah, ok. Check dependency walker or dumbpin /exports. There is no InternetSetOption function. Only these: InternetSetOptionA InternetSetOptionExA InternetSetOptionExW InternetSetOptionW You need to choose either the A or W version depending on what text encoding you're using. --bbTyro[a.c.edwards] wrote:Thanks, I have tried both /i, /noi, /system, combinations, and now switch. However, no attempt thus far has produced the desired result.Tyro[a.c.edwards] Wrote:You need to use the /system flag with implib. f:\usr\pkg\d>implib /h Digital Mars Import Library Manager Version 7.6B1n Copyright (C) Digital Mars 2000. All Rights Reserved. Usage: IMPLIB [switches] implibname.lib [ file.dll | file.def ] switches: /? Print this message /b Batch /h Print this message /i Ignore case of symbols /noi Be case sensitive. Mark library as case sensitive /nowep Ignore WEP /p:number Set page size to number (a power of 2) /system Prepend '_' to exported internal names (NT system DLL) ---bbI'm looking for some guidance on how to Internet Explorer options using functionality available in D. I am trying to make the following work but cannot since I don't have a copy of wininet.lib:I located wininet.dll and build from it a .lib file using implib. However when attempting to compile the program the following error occurs: Error 42: Symbol Undefined _InternetSetOption --- errorlevel 1 Is there something I am missing? Any advice is appreciated.
Dec 05 2007
Bill Baxter Wrote:Tyro[a.c.edwards] wrote:Unfortunately, that doesn't work either. I've used both options and gotten the same result. Again thanks for the assistance.Bill Baxter Wrote:Ah, ok. Check dependency walker or dumbpin /exports. There is no InternetSetOption function. Only these: InternetSetOptionA InternetSetOptionExA InternetSetOptionExW InternetSetOptionW You need to choose either the A or W version depending on what text encoding you're using. --bbTyro[a.c.edwards] wrote:Thanks, I have tried both /i, /noi, /system, combinations, and now switch. However, no attempt thus far has produced the desired result.Tyro[a.c.edwards] Wrote:You need to use the /system flag with implib. f:\usr\pkg\d>implib /h Digital Mars Import Library Manager Version 7.6B1n Copyright (C) Digital Mars 2000. All Rights Reserved. Usage: IMPLIB [switches] implibname.lib [ file.dll | file.def ] switches: /? Print this message /b Batch /h Print this message /i Ignore case of symbols /noi Be case sensitive. Mark library as case sensitive /nowep Ignore WEP /p:number Set page size to number (a power of 2) /system Prepend '_' to exported internal names (NT system DLL) ---bbI'm looking for some guidance on how to Internet Explorer options using functionality available in D. I am trying to make the following work but cannot since I don't have a copy of wininet.lib:I located wininet.dll and build from it a .lib file using implib. However when attempting to compile the program the following error occurs: Error 42: Symbol Undefined _InternetSetOption --- errorlevel 1 Is there something I am missing? Any advice is appreciated.
Dec 05 2007
Tyro[a.c.edwards] wrote:Bill Baxter Wrote:Did you use extern(Windows) or extern(System) when you declared the prototype for D to call? --bbTyro[a.c.edwards] wrote:Unfortunately, that doesn't work either. I've used both options and gotten the same result. Again thanks for the assistance.Bill Baxter Wrote:Ah, ok. Check dependency walker or dumbpin /exports. There is no InternetSetOption function. Only these: InternetSetOptionA InternetSetOptionExA InternetSetOptionExW InternetSetOptionW You need to choose either the A or W version depending on what text encoding you're using. --bbTyro[a.c.edwards] wrote:Thanks, I have tried both /i, /noi, /system, combinations, and now switch. However, no attempt thus far has produced the desired result.Tyro[a.c.edwards] Wrote:You need to use the /system flag with implib. f:\usr\pkg\d>implib /h Digital Mars Import Library Manager Version 7.6B1n Copyright (C) Digital Mars 2000. All Rights Reserved. Usage: IMPLIB [switches] implibname.lib [ file.dll | file.def ] switches: /? Print this message /b Batch /h Print this message /i Ignore case of symbols /noi Be case sensitive. Mark library as case sensitive /nowep Ignore WEP /p:number Set page size to number (a power of 2) /system Prepend '_' to exported internal names (NT system DLL) ---bbI'm looking for some guidance on how to Internet Explorer options using functionality available in D. I am trying to make the following work but cannot since I don't have a copy of wininet.lib:I located wininet.dll and build from it a .lib file using implib. However when attempting to compile the program the following error occurs: Error 42: Symbol Undefined _InternetSetOption --- errorlevel 1 Is there something I am missing? Any advice is appreciated.
Dec 05 2007
Bill Baxter Wrote:Tyro[a.c.edwards] wrote:Initially I used extern(Windows) but I just tried extern(System) and got the same result.Bill Baxter Wrote:Did you use extern(Windows) or extern(System) when you declared the prototype for D to call? --bbTyro[a.c.edwards] wrote:Unfortunately, that doesn't work either. I've used both options and gotten the same result. Again thanks for the assistance.Bill Baxter Wrote:Ah, ok. Check dependency walker or dumbpin /exports. There is no InternetSetOption function. Only these: InternetSetOptionA InternetSetOptionExA InternetSetOptionExW InternetSetOptionW You need to choose either the A or W version depending on what text encoding you're using. --bbTyro[a.c.edwards] wrote:Thanks, I have tried both /i, /noi, /system, combinations, and now switch. However, no attempt thus far has produced the desired result.Tyro[a.c.edwards] Wrote:You need to use the /system flag with implib. f:\usr\pkg\d>implib /h Digital Mars Import Library Manager Version 7.6B1n Copyright (C) Digital Mars 2000. All Rights Reserved. Usage: IMPLIB [switches] implibname.lib [ file.dll | file.def ] switches: /? Print this message /b Batch /h Print this message /i Ignore case of symbols /noi Be case sensitive. Mark library as case sensitive /nowep Ignore WEP /p:number Set page size to number (a power of 2) /system Prepend '_' to exported internal names (NT system DLL) ---bbI'm looking for some guidance on how to Internet Explorer options using functionality available in D. I am trying to make the following work but cannot since I don't have a copy of wininet.lib:I located wininet.dll and build from it a .lib file using implib. However when attempting to compile the program the following error occurs: Error 42: Symbol Undefined _InternetSetOption --- errorlevel 1 Is there something I am missing? Any advice is appreciated.
Dec 05 2007