Technology Questions

Go Back   Technology Questions > Hardware Questions > Electronics > Pocket PC General

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 10-06-2009, 08:20 AM
mohunt
Newsgroup Contributor
 
Posts: n/a
WM 5.0 InternetErrorDlg return ERROR_INVALID_HANDLE

I have written a WM 5.0 CF 3.5 vb.net app that tries to pinvoke
InternetErrorDlg to display a list of certificates to use for authentication
to a web service. I getting the error
ERROR_INVALID_HANDLE. I get this error whether set the hWnd parameter to
Null, the Handle property of the WinForm, or I use GetDesktopWindow from
coredll.dll to obtain the handle. My is code is below. Any help would be
greatly appreciated

<DllImport("WinInet.dll", _
EntryPoint:="InternetErrorDlg", _
CharSet:=CharSet.Unicode, SetLastError:=True)> _
Private Shared Function InternetErrorDlg( _
ByVal hWnd As IntPtr, _
ByRef hRequest As IntPtr, _
ByVal dwError As Int32, _
ByVal dwFlags As Int32, _
ByRef lpdwIndex As Int32) As Int32
End Function

iFlags = FLAGS_ERROR_UI_FLAGS_GENERATE_DATA +
FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS
lppvData = IntPtr.Zero
hWnd = GetDesktopWindow()
iResult = InternetErrorDlg(hWnd, m_Request, iError,
iFlags, lppvData)
Select Case iResult

Case ERROR_SUCCESS

Case ERROR_CANCELLED
m_ErrorMessage = "The function was canceled
by the user"

Case ERROR_INTERNET_FORCE_RETRY
m_ErrorMessage = "Function needs to redo its
request"

Case ERROR_INVALID_HANDLE
m_ErrorMessage = "InternetErrorDlg: The
handle to the parent window is invalid"
Case Else
m_ErrorMessage = "InternetErrorDlg: Error #"
+ iResult.ToString()
End Select

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 10-06-2009, 08:20 AM
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to return to V6 Unhappy with V7 Internet Explorer 2 03-28-2009 02:11 PM
Return Specialist TPC Tablet PC Jobs 0 09-20-2008 05:30 AM
Return to XP? George W. Barrowcliff Windows Vista 23 10-02-2007 05:10 PM
Return to XP DP Windows Vista 3 04-05-2007 07:45 AM
Return to I.E. 6? aarennels Windows XP 2 03-23-2007 05:15 PM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 02:15 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0