• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >vc/mfc > 我做的一个控件把它嵌入到网页中了,怎么在网页里提交这个控件的参数??100酬劳!!

我做的一个控件把它嵌入到网页中了,怎么在网页里提交这个控件的参数??100酬劳!!

作者:佚名 字体:[增加 减小] 来源:互联网 时间:2017-06-04

佚名通过本文主要向大家介绍了 我做的一个控件把它嵌入到网页中了,怎么在网页里提交这个控件的参数??100酬劳!!等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 我做的一个控件把它嵌入到网页中了,怎么在网页里提交这个控件的参数??100酬劳!!
描述:

我做的一个控件把它嵌入到网页中了,那这个控件里的函数的参数设置怎么通过此网页提交给WEBSERVER,我的WEBSERVER是一个C语言写的程序,WEBSERVER又是怎样把他接收到的参数传回给这个控件的?能提供一些这方面的摸板吗?我没用过ASP,不知道怎么网页中怎么处理控件的函数和参数的,举个例子好吗?


解决方案1:

場用技巧:
写脚本,取得值赋给一个隐藏文本筐,提交。

解决方案2:

from   text

解决方案3:

gz

解决方案4:

如果是控件内提交参数可以调用Microsoft Win32 Internet Functions,MSDN里面的相关代码很多。
如果需要使用页面提交空间参数则在页面中使用javascript或vbscript将空间中的参数读出后在用一个form把数据提交上去。开发WEBSERVER需要了解HTTP协议该协议由元信息头和数据两部分组成,具体可以参照相关的RFC文档。我只能给你提示实现原理,关于具体的开发还需要你参考一些相关文档,他们在MSDN里都有详细说明。

解决方案5:

CInternetSession m_Session("DigitalTitan");
    CHttpConnection* pServer=NULL;
    CHttpFile* pFile=NULL;
    CString strServerName=m_ServerName;
    INTERNET_PORT nPort=(INTERNET_PORT)atoi(m_ServerPort);
    CString strURL=m_DesignFile;
    try
    {
        pServer=m_Session.GetHttpConnection(strServerName,nPort);
pFile=pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST,strURL,NULL,1,NULL,NULL,INTERNET_FLAG_EXISTING_CONNECT);
CString strBoundary="-----------------------------7d33a816d302b6";
        pFile->AddRequestHeaders("Content-Type: multipart/form-data, boundary="+strBoundary);
        pFile->AddRequestHeaders("Accept: */*");
char* pBuf=new char[1024*1000];
pFile->SendRequest(NULL,0,(LPVOID)pBuf,strlen(pBuf));
pFile->Close();
pServer->Close();
    }
    catch(CInternetException * e)
    {
AfxMessageBox("...",MB_ICONINFORMATION);
    };
    delete pFile;
    delete pServer;
    m_Session.Close();

解决方案6:

<OBJECT id="cmd1" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 40px" classid="clsid:D7053240-CE69-11CD-A777-00DD01143C57" VIEWASTEXT>
<PARAM NAME="ForeColor" VALUE="2147483666">
<PARAM NAME="BackColor" VALUE="2147483663">
<PARAM NAME="VariousPropertyBits" VALUE="27">
<PARAM NAME="Caption" VALUE="Click Me">
<PARAM NAME="PicturePosition" VALUE="458753">
<PARAM NAME="Size" VALUE="2540;847">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="Accelerator" VALUE="0">
<PARAM NAME="TakeFocusOnClick" VALUE="-1">
<PARAM NAME="FontName" VALUE="Times New Roman">
<PARAM NAME="FontEffects" VALUE="1073741824">
<PARAM NAME="FontHeight" VALUE="240">
<PARAM NAME="FontOffset" VALUE="0">
<PARAM NAME="FontCharSet" VALUE="0">
<PARAM NAME="FontPitchAndFamily" VALUE="34">
<PARAM NAME="ParagraphAlign" VALUE="3">
<PARAM NAME="FontWeight" VALUE="400">
</OBJECT>

解决方案7:

Initializing from HTML
In the same way that you can initialize a Visual Basic ActiveX control, you can initialize an ATL control using the <PARAM> tags. When you include the <PARAM> tags as children of the <OBJECT> tags, Internet Explorer sends the data that you specify to the control when the control is first instantiated. For example, to specify an initial value for the Message property, you can insert a <PARAM> tag between the opening and closing object tags for the control. This HTML code looks like this:
<OBJECT ID="AtlCtrl"
        CLASSID="CLSID:638B718E-AEF1-11D2-A9BA-444553540001">
        <PARAM NAME="Message" VALUE="Hello, There!">
</OBJECT>
 
This data is stored in a property bag object maintained by Internet Explorer. Internet Explorer will query the control for the IPersistPropertyBag interface. If the control returns a pointer to this interface, Internet Explorer calls the Load method of IPersistPropertyBag to instruct the control to load initialization data. When calling the Load method, Internet Explorer passes a pointer to IPropertyBag interface of its property bag object. The control then calls the Read method of the passed in IPropertyBag interface to retrieve the initialization data.
To make this work correctly in the AtlCtrl control, you need to follow a few steps. As usual, ATL provides a default implementation of IPersistPropertyBag named IPersistPropertyBagImpl. Add this template class to the end of the inheritance list. After adding the template class, the declaration of CAtlCtrl should look like this:
class ATL_NO_VTABLE CAtlCtrl : 
   
   
   public IPersistPropertyBagImpl<CAtlCtrl>
{
   
   
};
 
Add the IPersistPropertyBag interface to the COM map. After adding this interface, the COM map should look like this:
BEGIN_COM_MAP(CAtlCtrl)
   
   
   COM_INTERFACE_ENTRY(IPersistPropertyBag)
END_COM_MAP()
 
Implement the Load method, as shown in the next code fragment. You can add this method to the bottom&nb

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 我做的一个控件把它嵌入到网页中了,怎么在网页里提交这个控件的参数??100酬劳!!

相关文章

  • 2017-06-05 添加厂家提供的activeX控件后,运行时出现assert错误
  • 2017-06-04 BHO捕获flv真实URL的问题!
  • 2017-06-04 [求助]VC自带“ActiveMovieControlObject”吗
  • 2017-06-04 BHO中如何重绘窗体
  • 2017-06-04 为什么我的对象的接口只有在dual情况下,才能在跨套间marshal
  • 2017-06-05 com编程中的channing是什么含义?channing中文叫什么?
  • 2017-06-05 100分:谁能将com线程模型将清楚?请大家踊跃发言,有分!!!
  • 2017-06-05 问一个有关MIDLEXE的初级问题!!
  • 2017-06-05 高手请教:如何拦截其他程序的启动?
  • 2017-06-04 ATL初学者!问题

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • 如何使ActiveX控件画出进度条?
    • 100分求解关于多线程限制的问题。
    • 怎样获得本窗口的句柄?
    • 没有调用::ReleaseMutex为什么::WaitForSingleObjecthMutex,INFINITE)?还能返回
    • 如何在dll里将一个程序传给DLL的CString变量作为参数传给另一个exe文件,并调用这个exe文件?
    • 请问,关于命名管道的安全问题。
    • 嵌入Object的页面,IE因为多次刷新而崩溃,请问是什么原因导致的??
    • 对连接点事件的一点小结,如有不对,请指正
    • 根据进程ID,如何得到该进程使用内存的大小?
    • CreateThread无法传参数

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有