線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1747
推到 Plurk!
推到 Facebook!

如何將COM 元件登錄到Registry

尚未結案
energybody
一般會員


發表:44
回覆:32
積分:15
註冊:2007-04-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2010-09-30 14:53:35 IP:114.42.xxx.xxx 訂閱
小弟初學BCB 6,用的是 Windows 7,建立了一個COM 元件,但是無法將此COM元件登錄到Registry,可能是因為權限不夠或其他的原因,希望各位大大幫忙.

// URLCODERIMPL : Implementation of TURLCoderImpl (CoClass: URLCoder, Interface: IURLCoder)
#include
#pragma hdrstop
#include "URLCODERIMPL.H"
#include
#include "Main.h"
/////////////////////////////////////////////////////////////////////////////
// TURLCoderImpl
STDMETHODIMP TURLCoderImpl::Decode(LPSTR inStr, LPSTR* outStr)
{
TNMURL *url = new TNMURL(NULL);
try
{
AnsiString msg;
msg = Now().DateTimeString() " : ";
msg = "A COM Client Connect , and decode the string\"";
msg = inStr;
msg = "\"";
Form1->Memo1->Lines->Add(msg);
url->InputString = inStr;
*outStr = url->Decode.c_str();
}
catch (Exception &e)
{
return Error(e.Message.c_str(), IID_IURLCoder);
}
return S_OK;
}
STDMETHODIMP TURLCoderImpl::Encode(LPSTR inStr, LPSTR* outStr)
{
TNMURL *url = new TNMURL(NULL);
try
{
AnsiString msg;
msg = Now().DateTimeString() " : ";
msg = "A COM Client Connect , and encode the string\"";
msg = inStr;
msg = "\"";
Form1->Memo1->Lines->Add(msg);
url->InputString = inStr;
*outStr = url->Encode.c_str();
}
catch (Exception &e)
{
return Error(e.Message.c_str(), IID_IURLCoder);
}
return S_OK;
}


CH31_001_TLB.cpp:
// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //
// C TLBWRTR : $Revision: 1.151.1.0.1.27 $
// File generated on 2010/9/30 上午 11:39:04 from Type Library described below.
// ************************************************************************ //
// Type Lib: C:\Program Files (x86)\Borland\CBuilder6\Projects\CH31_001.tlb (1)
// LIBID: {898CA184-5C40-408D-86E1-5E4AC4585D78}
// LCID: 0
// Helpfile:
// HelpString: CH31_001 Library
// DepndLst:
// (1) v2.0 stdole, (C:\Windows\SysWOW64\stdole2.tlb)
// ************************************************************************ //
#include
#pragma hdrstop
#include "CH31_001_TLB.h"
#if !defined(__PRAGMA_PACKAGE_SMART_INIT)
#define __PRAGMA_PACKAGE_SMART_INIT
#pragma package(smart_init)
#endif
namespace Ch31_001_tlb
{

// *********************************************************************//
// GUIDS declared in the TypeLibrary
// *********************************************************************//
//*********************************************************************//
// NOTE: This file is no longer used. GUIDS previously defined in this
// file are now defined in the header itself, using __declspec(selectany).
//********************************************************************//
}; // namespace Ch31_001_tlb
編輯記錄
energybody 重新編輯於 2010-09-30 14:54:55, 註解 無‧
aftcast
站務副站長


發表:81
回覆:1485
積分:1763
註冊:2002-11-21

發送簡訊給我
#2 引用回覆 回覆 發表時間:2010-10-01 19:12:51 IP:210.64.xxx.xxx 訂閱
可能是registry 該注在不同的地方問題,你是使用x64版的win7 吧?

有空讀一下下面的網址。雖然不一定可解決問題,但是值得了解與參考的!

http://technet.microsoft.com/zh-tw/library/dd180732.aspx
------


蕭沖
--All ideas are worthless unless implemented--

C++ Builder Delphi Taiwan G+ 社群
http://bit.ly/cbtaiwan
系統時間:2024-04-26 1:55:01
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!