Tutorials to .com

Tutorials to .com » Dotnet » Application » How to use vb6.0 to achieve the Chinese real name search

How to use vb6.0 to achieve the Chinese real name search

Print View , by: iSee ,Total views: 13 ,Word Count: 548 ,Date: Wed, 26 Aug 2009 Time: 4:07 AM

In the c + + is very easy to implement, because the C++ + + can manipulate the pointer, but vb is not a very good to play this, so they need to achieve through the library

Bluntly, is to find a middle layer, so that he translated into vb able to recognize the stuff used, no bullshit, and started slightly

Chinese real name is none other than ie the iurlsearchhook, but 3721 is not so played with, he is using the api hook block ie commbox news,,,, you are simply fast, but he, hey,, 3721 sinister to,,, although we can not to achieve the global hook,, also in the vb only use sub class sub-class technology, strategy,, this thing that we could not finish, and we play another kind of

We must first realize IObjectWithSite, IUnknown these two interfaces,,

We need to create an odl file, through which to create a tlb

uuid (CF9D9B76-EC4B-470D-99DC-AEC6F36A9261),
helpstring ( "VB IObjectWithSite Interface"),
version (1.0)
library IObjectWithSiteTLB
importlib ( "stdole2.tlb");
typedef [public] long GUIDPtr;
typedef [public] long VOIDPtr;
uuid (00000000-0000-0000-C000-000000000046),
interface IUnknownVB
HRESULT QueryInterface (
[in] GUIDPtr priid,
[out] VOIDPtr * pvObj
long AddRef ();
long Release ();
uuid (FC4801A3-2BA9-11CF-A229-00AA003D7352),
interface IObjectWithSite: IUnknown
typedef IObjectWithSite * LPOBJECTWITHSITE;
HRESULT SetSite ([in] IUnknownVB * pSite);
HRESULT GetSite ([in] GUIDPtr priid, [in, out] VOIDPtr * ppvObj);

It is saved as odl Then, using typelib to create a tlb file is created that we refer to this document

Add the following code

Implements IObjectWithSiteTLB.IObjectWithSite
Dim WithEvents IE As InternetExplorer
Dim M_Site As IUnknownVB

Private Sub IObjectWithSite_GetSite (ByVal Priid As IObjectWithSiteTLB.GUIDPtr, PPVobj As IObjectWithSiteTLB.VOIDPtr)
M_Site.QueryInterface Priid, PPVobj
End Sub

Private Sub IObjectWithSite_SetSite (ByVal pSite As IObjectWithSiteTLB.IUnknownVB)
Set M_Site = pSite
Set IE = pSite
End Sub

We have now achieved these two interfaces, in order to achieve our Chinese language search, we can not use urlsearchhook

Therefore, we InternetExplorer through the interface functions to achieve our

Private Sub IE_BeforeNavigate2 (ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)

Here you need to fill in the code,.
End Sub

Specifically does not say, and,. . Everyone to see themselves slightly

You need to add to the registry brow help object inside,, the name of the classid for the com

.Net Application Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.