Actual combat COM (05) ---- Create a COM + application

zhaozj2021-02-08  231

This article is welcome to reprint, please specify the source and the author blackcolor@263.net -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -----------------

Create a COM application

In the process of the process we created in the second section, the component is installed in the COM on Windows 2000 in the process, then call it from Win98.

First, the WINDOWS 20001) Create a directory STEP012 in Win2000) STEP012) Copy Client.exe and Step01.dll to Step01 Directory 3) Open Windwos 2000 Menu "Start | Program | Administrative Tools | Components" 4) Expand "Component Services -> Computer-> My Computer -> Com Application "5) Right-click" COM Application ", select" New | Application "from the menu, open" Welcome Com App Installation Wizard "window 6) Click "Next", click "Create an empty application" button 7) Enter "Step01" in the application name, do not modify the activation type, click "Next" 8), click "Next", Then click Finish. We created an empty application. 9) Expand "Step01", right-click "Components", select "New | Components" from the pop-up menu, open "Welcome to the COM Component Installation Wizard" window 10) Click "Next", then click "Install new Component "Button 11) Find" Step01 "directory, select Step01.dll file, click Next, click Finish 12) This, we created a simple COM application 13) Running the client in the MS DOS window. EXE is that it is found that the prompt is: CREATE COM FAILED! HR = 0x8000401A14) Right-click "STEP01", select "Properties" menu, in the "STEP01 Properties" window, select the "Identifier" tab, modify the "This user" Enter the user as: administrator, enter the user's password and confirmation password. 15) Click OK, then run client.exe, at this time, you should prompt: The OS WinNT, proof COM installation correct

Second, from Windows 2000 Export Document 16) Right click on "Step01", select "Export" menu, open "Welcome to COM App Export Wizard" window 17) Click Next, set the directory to STEP01 , The file name is Step01.msi, "Export to" Select "Application Agent - Install on other computers, use to access this computer," click "Next", click Finish.

Third, for Windows 981) Copying the CLIENT.EXE and STEP01PS.DLL in the second section to the Step01New directory in the second section to copy the Step01.msi and Step01.msi.cab exported to the Step01New directory. 3) Run Unsvr32 Step01ps.dll command registration proxy / stub, 4) Click Step01.msi in the Explorer, will automatically install the client 5) Run Client.exe, if prompted: The OS Win95 / 98, then you need to log out of the original registered Step01.dll, you can find the original Step01 / debug directory to log out with Regsvr32 / U Step01.dll

Fourth, possible errors may appear in Windows 98: CREATE COM FAILED! HR = 0x80040154 error Need to detach all installed content Reinstall: Regsvr32 / u Step01ps.dllregsvr32 / u Step01.dll in "Control Panel | Add / Delete Programs Select "STEP01 (Application Proxy)" to uninstall, click Step01.msi in the Explorer, will automatically install the client, register Proxy / Stub 5 with regsvr32 step01ps.dll, Description: 1) I didn't modify any other attributes not mentioned in the above settings; 2) I didn't use any of the characteristics about COM , just simply install a COM application, please refer to the MSDN for the information 3) If you do not want to copy Step01ps.dll to the client machine, select "Allow Merging of Proxy / Stub Code" in "ATL COM AppWizard - Step 1 of 1" when you create a component, uninstall the client in the Control Panel | Add / Remove Programs Select "Step01 (Application Proxy)" for uninstall 5) Please log in with Administrator in Windows 2000.

转载请注明原文地址:https://www.9cbs.com/read-1985.html

New Post(0)