Bin
Iii. asp calls COM components
1. Add
2. In ASP, you can use X to call methods in the COM component class:Set x = server. Createobject ("component name. Class Name ")
Http://www.cnblogs.com/rentj1/archive/2009/02/23/1396187.html
1. Create a class library mytestdll.
2. Right-click the project "mytestdll"-"properties-" generate-"and select" register for
example, open a new ADO Connection object, open a traditional ACCESS database for ODBC, and then execute the SQL query, a record set object will be returned. Then we will display the first three fields of the record set.
$ Dbc = new COM ("ADODB. Connection ");$ Dbc-> Provider = "MSDASQL ";$ Dbc-> Open ("nwind ");$ Rs = $ dbc-> Execute ("select * from products ");$ I = 0;While (! $ Rs-> EOF ){$ I + = 1;$ Fld0 = $ rs-> Fields (0 );$ Fld1 = $ rs-> Fiel
OLEDB has a reputation for being faster than ODBC.
ADO is the API for packaging ODBC and OLEDB.
In this example, open a new ADO Connection object, open a traditional access (favorite of small websites) database for ODBC, and then execute SQL query, a record set object will be returned. Then we will display the first three fields of the record set.
$ Dbc = new COM ("ADODB. Connection ");
$ Dbc-> Provider = "MSDASQL ";
$ Dbc-> Open ("nwind
, but OLEDB has a reputation for being faster than ODBC.
ADO is the API for packaging ODBC and OLEDB.
In this example, open a new ADO Connection object, open a traditional ACCESS database for ODBC, and then execute the SQL query, a record set object will be returned. Then we will display the first three fields of the record set.
$ Dbc = new COM ("ADODB. Connection ");
$ Dbc-> Provider = "MSDASQL ";
$ Dbc-> Open ("nwind ");
$ Rs = $ dbc-> E
How to call Asscess database and COM program via ADO in PHP author: John Lim.
Znsoft (http://www.phpease.com znsoftm@21cn.com)
PHP4 already supports Microsoft's COM technology. However, the COM section is rarely mentioned in this document.
Here are some examples I have tried. I hope these will give you some ideas. No
Generally, you can use cocreateinstance to call the COM component. However, for the COM component that implements the idispatch interface, it is easier to call the COM component by using the coledispatchdriver package class of the VC ++ automatically generated interface. Exa
code.As you can see from the explanation, this class is primarily used to allocate unmanaged memory and to convert between managed and unmanaged types.So I took a look at the members of the Mashal class and found a method:And this method itself can achieve the above mallocintptr the function of this method, so I will change the code as follows:New Signclass (); string Certpath == marshal.stringtobstr (certpath); int result = signclass.verify (prestr, sign, ptrcertfile); Marshal.freebstr (ptrcer
How to call a function that contains IntPtr parameters in the com component?
Background
The company's payment platform recently docked with the payment interface of Xi'an mobile. The signature method in the interface is that the other party provides a com component, the component contains a signature method and a signature verification method. After the signature
How to call a function that contains IntPtr parameters in the com component?
Background
The company's payment platform recently docked with the payment interface of Xi'an mobile. The signature method in the interface is that the other party provides a com component, the component contains a signature method and a signature verification method. After the signature
When C # Calls the com DLL package library compiled by C ++, two problems will occur: 1. Data type conversion problem 2. pointer or address parameter transfer problem first, data type conversion problem. Because C # Is the. NET language and uses the basic data type of. net, C ++ actually corresponds to the basic data type of. net. For example, the original function of C ++ is: int _ stdcall functionname (unsigned char param1, unsigned short param2). T
Last wrote how in VC6.0 under Delphi write COM to invoke, originally wanted to write immediately how in Delphi call VC6.0 development of COM, because in write case program encountered a very strange problem, in my machine with VC written interface program compiled can pass. But the call will have a problem, (in the VC
The COM server is an in-process server, and the DLL name is simpcom. dll. This component has only one interface ifoo, and this interface has only one method hresult sayhello (void)
Call in SDK============================================1. The simplest and most common method is to use the # Import Type Library and the smart pointer packaging class provided by VC.DemoCode:
# Import "D: \ temp \ Vc \
PHP4 already supports Microsoft's COM technology. However, the COM section is rarely mentioned in this document. Here are some examples I have tried. I hope these will give you some ideas. Note that these can only run on 32-bit Microsoft Windows platforms. Activating ADOADO with php is Microsoft's database object technology. ADSyntaxHi
PHP4 already supports Microsoft's
; Provider = "MSDASQL ";$ Dbc-> Open ("nwind ");$ Rs = $ dbc-> Execute ("select * from products ");$ I = 0;While (! $ Rs-> EOF ){$ I + = 1;$ Fld0 = $ rs-> Fields (0 );$ Fld1 = $ rs-> Fields (1 );$ Fld2 = $ rs-> Fields (2 );Print "$ fld0-> value $ fld1-> value $ fld2-> value $ Rs-> MoveNext ();}$ Rs-> Close ();?>Use PHP to call Microsoft WordThis is another example:$ Word = new COM ("word. application") or d
and methods in the Root/wmi namespace instead of something that was originally driven.
Unfortunately, some of the documentation on MSDN is inconsistent with the data actually embodied by the WMI tool provided by MS, as with the two parameters of the Setbrightness method of the Wmisetbrightnessmethods class. Uint8 and UInt64 seems to be prepared for the Dotnet platform as well, in put in these two parameters, hres return S_OK, but in the ExecMethod, there will be type mismatch error, let a perso
; Execute ("select * from products ");$ I = 0;While (! $ Rs-> EOF ){$ I + = 1;$ Fld0 = $ rs-> Fields (0 );$ Fld1 = $ rs-> Fields (1 );$ Fld2 = $ rs-> Fields (2 );Print "$ fld0-> value $ fld1-> value $ fld2-> value";$ Rs-> MoveNext ();}$ Rs-> Close ();?> Use PHP to call Microsoft WordThis is another example:
$ Word = new COM ("word. application") or die ("Cannot start Microsoft Word ");
Prin
registry)
Coinitialize (null );Cgetres getrest;If (getrest. createdispatch ("mycom. getres ")! = 0){Getrest. Hello ();Getrest. releasedispatch ();}Couninitialize ();-- Note --------------------------------------------------------------In fact, the smart pointer in COM is a class that is overloaded->, so as to simplify the reference count. Program Call addref () and release (), but why are we in method 1?Pg
--
SQL Server Stored Procedures call COM components
/* -- The following part is completed in VB. First, use VB as the simplest Component Project name: testsqlcom.Class Name: testmath' function, which calculates the result of adding two integersPublic Function addme (A as long, B As long) as longAddme = a + BAfter the end function is compiled and generated, we can call
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.