Passing string parameters to an ActiveX control on web page

Passing string parameters to an ActiveX control on web page

Post by wayneglanf » Sat, 13 Sep 2003 20:01:03


I need to pass several login parameters i.e. user, password etc. to an
activex control on a web page. Creating an instance of the control on
the web page and calling the method of the control with the
appropriate values is fine.

However, I am not sure exactly how to define my interface method in
the Aactivex control, or rather what types of variables should I
define the interface arguments list. I also need to convert these to a
wchar_t type to pass to a method of a 3rd party libray.

Could anyone please help with this.

I have tried the following definition and conversion of variables to
the required types but this does not work as I expect.

STDMETHODIMP CWVPN::CONNECT(BSTR user, BSTR password, BSTR domain,
BSTR profile, int *pVal)
{
wchar_t *m_pUser;
wcscpy(m_pUser, user);

}
 
 
 

Passing string parameters to an ActiveX control on web page

Post by ashleye » Tue, 16 Sep 2003 15:35:08

It should be of VARIANT types. An easy way to debug your control may be
writing a simple HtmlView control application and then loading the page in
the viewer. Now set the debugger for your control project as your HTMLView
control. You should be able to set breakpoints inside your function to see
how exactly your data is passed from the html side.

Ashley Antony Elenjickal
Devp Support - Windows Embedded
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: XXXX@XXXXX.COM (Dr G)
Newsgroups: microsoft.public.pocketpc.developer
Subject: Passing string parameters to an ActiveX control on web page
Date: 12 Sep 2003 04:01:03 -0700
Organization: http://groups.google.com/
Lines: 22
Message-ID: < XXXX@XXXXX.COM >
NNTP-Posting-Host: 193.129.186.29
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1063364467 30068 127.0.0.1 (12 Sep 2003
11:01:07 GMT)
X-Complaints-To: XXXX@XXXXX.COM
NNTP-Posting-Date: 12 Sep 2003 11:01:07 GMT
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!postnews1
google.com!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.pocketpc.developer:60441
X-Tomcat-NG: microsoft.public.pocketpc.developer

I need to pass several login parameters i.e. user, password etc. to an
activex control on a web page. Creating an instance of the control on
the web page and calling the method of the control with the
appropriate values is fine.

However, I am not sure exactly how to define my interface method in
the Aactivex control, or rather what types of variables should I
define the interface arguments list. I also need to convert these to a
wchar_t type to pass to a method of a 3rd party libray.

Could anyone please help with this.

I have tried the following definition and conversion of variables to
the required types but this does not work as I expect.

STDMETHODIMP CWVPN::CONNECT(BSTR user, BSTR password, BSTR domain,
BSTR profile, int *pVal)
{
wchar_t *m_pUser;
wcscpy(m_pUser, user);

}

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 It should be of VARIANT types. An easy way to debug your control may be writing a simple HtmlView control application and then loading the page in the viewer. Now set the debugger for your control project as your HTMLView control. You should be able to set breakpoints inside your function to see how exactly your data is passed from the html side.
\par
\par Ashley Antony Elenjickal
\par Devp Support - Windows Embedded
\par Microsoft Corporation
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par \pard\li720 --------------------
\par From: XXXX@XXXXX.COM (Dr G)
\par Newsgroups: microsoft.public.pocketpc.developer
\par Subject: Passing string parameters to an ActiveX control on web page
\par Date: 12 Sep 2003 04:01:03 -0700
\par Organization: http://groups.google.com/
\par Lines: 22
\par Message-ID: < XXXX@XXXXX.COM >
\par NNTP-Posting-Host: 193.129.186.29
\par Content-Type: text/plain; charset=ISO-8859-1
\par Content-Transfer-Encoding: 8bit
\par X-Trace: posting.google.com 1063364467 30068 127.0.0.1 (12 Sep 2003 11:01:07 GMT)
\par X-Complaints-To: XXXX@XX