| |

VerySource

 Forgot password?
 Register
Search
Author: oni888

How do I use ADO inside a control when writing an OCX control?

[Copy link]

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-4 01:30:01
| Show all posts
In stdafx.h

#pragma warning(disable: 4146)
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename( "EOF", "adoEOF")
#pragma warning(default: 4146)

In xxx.odl
library XCOMBOXLib
{
         importlib(STDOLE_TLB);
importlib(STDTYPE_TLB);
     //------------------------------Add the following, if the system is not installed in the c drive, change c: to other That's it
importlib("c:\program files\common files\system\ado\msado15.dll");

         //[id(30)] IDispatch* DataSourceOfRst; Change IDispatch* to _Recordset* to expose the automation of the DataSourceOfRst property in VB, delphi, or put a point after DataSourceOfRst, ADO record-level methods and properties are not Will be listed automatically
           [id(30)] _Recordset* DataSourceOfRst;//You cannot write _Recordset* as _RecordsetPtr here, because _RecordsetPtr is a macro definition of _Recordset*, but it is not defined in odl, so an error will be reported
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list