Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 83437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:46:24+00:00 2026-05-10T21:46:24+00:00

A rather odd experience. Using the latest PDK (v7.3) from ActiveState, I used perlctrl

  • 0

A rather odd experience. Using the latest PDK (v7.3) from ActiveState, I used perlctrl to build a COM DLL. Perlctrl ran without a hitch. OLEView read the typelib okay. RegSvr32 registered it okay. However … there’s no sign of it in registry, and anything that tries to use it fails. I hunted for the various UIDs using RegEdit and they’re just not there.

The code is below. It’s a wrapping of Lingua::ZH::WordSegmenter, but with the encoding changed to utf8 rather than gbk.

It’s probably something obvious …

package ZHWordSeg;  use strict; use warnings; use utf8; use ws;  use Encode;  use constant STX => chr( 2 ); #[ use constant ETX => chr( 3 ); #] use constant FS => chr( 28 ); #^ use constant RS => chr( 30 ); #~  use constant TAB_SEPARATOR => 0; use constant CARET_SEPARATOR => 1; use constant FS_SEPARATOR => 2; use constant SPACE_SEPARATOR => 3; use constant AS_ARRAY => 4;  use feature 'switch';  our $segmenter;   sub ZHWordSeg_Setup {   my $dic = shift;   my $dic_encoding = shift;   my $separator = shift;   my $verbose = shift;    $dic_encoding = 'utf8' unless defined( $dic_encoding );   $separator = ' ' unless defined( $separator );   $verbose = 0 unless defined( $verbose );    if ( defined( $dic ) ) {     $segmenter = ws->new( dic => $dic, dic_encoding => $dic_encoding, seperator => $separator, verbose => $verbose );   } else {     $segmenter = ws->new( dic_encoding => $dic_encoding, seperator => $separator, verbose => $verbose );   } }  sub ZHWordSeg {   my $source = shift;   print STDERR $source;   my $sepcode = shift;   $source = encode('utf8',$source);   my $stringres = $segmenter->seg($source);   my @arrayres;    given ($sepcode) {     when (TAB_SEPARATOR) {        $stringres =~ tr/ /\t/;       return $stringres;     }     when (CARET_SEPARATOR) {        $stringres =~ tr/ /^/;       $stringres .= '^';       return $stringres;     }     when (FS_SEPARATOR) {        $stringres =~ s/ /FS/eg;       $stringres .= FS;       return $stringres;     }     when (SPACE_SEPARATOR) {        return $stringres;     }     default {        @arrayres = split( / /, $stringres );       return \@arrayres;     }   } }  sub SetDictionary {   my ($source) = shift;   my $res = set_dic($source);   return $res; }  1;  =pod  =begin PerlCtrl  %TypeLib = (   PackageName     => 'ZHWordSeg',   DocString       => 'Chinese word segmentation',   HelpContext     => 1,   TypeLibGUID     => '{F6C9BD66-7CA1-4610-B77F-E219A7122C18}', # do NOT edit this line   ControlGUID     => '{45D47C6A-2B9A-4D62-9CFD-F18C95DC00C5}', # do NOT edit this line either   DispInterfaceIID=> '{007E4E7A-3B75-4DC3-864C-7746860941B3}', # or this one   ControlName     => 'BOCWS',   ControlVer      => 2,  # increment if new object with same ProgID   # create new GUIDs as well   ProgID          => 'ZHWordSeg.BOCWS',   LCID            => 0,   DefaultMethod   => 'ChineseWordSegmenter',   Methods         => {       'ChineseWordSegmenter' => {         RetType             =>  VT_VARIANT,         TotalParams         =>  2,         NumOptionalParams   =>  1,         ParamList           =>             [ 'source' => VT_BSTR,             'sepcode' => VT_I4           ]        },       'ChineseWordSegmenter_Setup' => {         RetType             =>  VT_VARIANT,         TotalParams         =>  4,         NumOptionalParams   =>  4,         ParamList           =>             [ 'dic' => VT_BSTR,             'dic_encoding' => VT_BSTR,             'separator' => VT_BSTR,             'verbose' => VT_BSTR           ]        }   },  # end of 'Methods'   Properties        => {     TAB_SEPARATOR => {       DocString  => 'Separate items with TAB (0x0)',       Type => VT_I4,        DispID => 3,       ReadOnly => 1,     },     CARET_SEPARATOR => {       DocString  => 'Separate items with ^ (0x1)',       Type => VT_I4,        DispID => 4,       ReadOnly => 1,     },     FS_SEPARATOR => {       DocString  => 'Separate items with ascii 28 (0x2)',       Type => VT_I4,        DispID => 5,       ReadOnly => 1,     },     SPACE_SEPARATOR => {       DocString  => 'Separate items with space (0x3)',       Type => VT_I4,        DispID => 6,       ReadOnly => 1,     },     AS_ARRAY => {       DocString  => 'Separate items as array (0x4)',       Type => VT_I4,        DispID => 7,       ReadOnly => 1,     }   },  # end of 'Properties' );  # end of %TypeLib  =end PerlCtrl  =cut 

This is the .perlctrl file, in case it matters:

#!C:\Program Files\ActiveState Perl Dev Kit 7.3 Deployment\bin\lib\pai.exe PAP-Version: 1.0 Packer: C:\Program Files\ActiveState Perl Dev Kit 7.3 Deployment\bin\perlctrl.exe Script: ZHWordSeg.ctrl Cwd: P:\BOCWS Byref: 0 Clean: 0 Date: 2008-10-24 18:05:42 Debug: 127.0.0.1:2000 Dependent: 0 Dyndll: 0 Exe: BOCWS.dll Force: 1 Gui: 0 Hostname: xi No-Compress: 0 No-Gui: 0 No-Logo: 0 Runlib:  Shared: none Singleton: 0 Tmpdir:  Verbose: 0 Version-Comments:  Version-CompanyName:  Version-FileDescription: Wrapper of Lingua::ZH::WordSegmenter.pm Version-FileVersion: 1.0 Version-InternalName: ZHWordSeg Version-LegalCopyright:  Version-LegalTrademarks:  Version-OriginalFilename: ZHWordSeg.ctrl Version-ProductName: BOChineseWordSegmenter Version-ProductVersion: 1.0 Warnings: 0 Xclude: 1 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:46:25+00:00Added an answer on May 10, 2026 at 9:46 pm

    The only "solution" that I’ve found was suggested over on news:comp.os.ms-windows.programmer.win32

    i am not a PDK user but from experience i can tell you, that you should check the DllRegister exports code and what it internally does, since this is what the regsvr32 calls and this code is creating the registry keys for your com server/proxy, etc, …

    You can track the registry for changes with sysinternal tools like regmon or procmon, just to make sure!

    Ultimately, I gave up and went back to a previous version that worked and tweaked it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

(EDIT: This question is now outdated for my particular issue, as Google Code supports
I have encountered a rather odd error that I do not understand. I created
I've recently installed VS2008. The project I'm working on uses vstest and I have
The arguments object in JavaScript is an odd wart—it acts just like an array

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.