problems using OLE Automation and ActiveX in PB 6

We are writing a PowerBuilder application that can be used as OLE Runtime
Automation Server.
We are using PowerBuilder 6.0 beta 3.

We've built a 32-bit .pbd and made it a DLL ( OLE server )
We've used PowerBuilder sample program PBGENREG.PBL to generate .reg and
.tlb (type library) files.
We've installed PowerBuilder deployment on Windows NT 4.0 server and tried
to register
it with the system using "regsvr32.exe" program.

We are getting an eror message:

"C:\MyOLEServer.dll was loaded, but the DllRegisterServer entry point was
not found.
DllRegisterServer may not be exported, or corrupted version is in
memory..."

DllRegisterServer() registers DLL type library with the system and should
be generated by PowerBuilder.

To be an ActiveX control , our DLL must be a COM object, export
DLLRegisterServer and DLLUnRegisterServer.
 
// C++ code for that function
STDAPI DllRegisterServer( void )
{
    AFX_MANAGE_STATE(_afxModuleAddrThis);
    
    // Registers the type library with the Windows registration database 
    // and allows the type library to be used by other containers that are
OLE-control aware.                 // This function updates the registry
with the type library name and its location 
    //  on the system.	
    if ( ! AfxOleRegisterTypeLib ( AfxGetInstanceHandle( ), _tlid ) )
        return ResultFromScode( SELFREG_E_TYPELIB );
    
    AfxOleRegisterTypeLib ( AfxGetInstanceHandle(), _tlid, _T(
"MyOLEServer.tlb" ) )

    if ( ! COleObjectFactoryEx :: UpdateRegistryAll ( TRUE ) )
        return ResultFromScode( SELFREG_E_CLASS );

    return NOERROR;
}

Is there an option in PowerBuilder 5.0.3 or PowerBuilder 6 that adds
DllRegisterServer function to generated by PowerBuilder OLE server DLL?
Is there a utility from PowerSoft that solves that problem?
What other options do we have to make OLE Server (ActiveX control) to work?

I can see my OLE Automation object with "OLE Viewer".

But when I tried to access this OLE Automation using ActiveX Server Page
and VBScript - VBScript function was unable to create this object.
Isn't PowerBuilder 6 should be able to create ActiveX?



0
Yakov
11/11/1997 8:32:29 PM
sybase.ole-ocx-activex 6324 articles. 0 followers. Follow

2 Replies
858 Views

Similar Articles

[PageSpeed] 52

Sounds like you might need to modify it's reg file for it's location. There
are two entries in it that set the path to the DLL - you can't miss them.

BTW once you do that just merge it with the registry. You don't need the
regsvr32.exe program. If you want to automate that step I recommend
InstallShield (a version of which is supposed to be included with the final
release of PowerBuilder)

me


Yakov Soblev wrote in message <01bceee9$d752a6c0$63859f96@dunt1857>...
>We are writing a PowerBuilder application that can be used as OLE Runtime
>Automation Server.
>We are using PowerBuilder 6.0 beta 3.
>
>We've built a 32-bit .pbd and made it a DLL ( OLE server )
>We've used PowerBuilder sample program PBGENREG.PBL to generate .reg and
>tlb (type library) files.
>We've installed PowerBuilder deployment on Windows NT 4.0 server and tried
>to register
>it with the system using "regsvr32.exe" program.
>
>We are getting an eror message:
>
>"C:\MyOLEServer.dll was loaded, but the DllRegisterServer entry point was
>not found.
>DllRegisterServer may not be exported, or corrupted version is in
>memory..."
>
>DllRegisterServer() registers DLL type library with the system and should
>be generated by PowerBuilder.
>
>To be an ActiveX control , our DLL must be a COM object, export
>DLLRegisterServer and DLLUnRegisterServer.
>
>// C++ code for that function
>STDAPI DllRegisterServer( void )
>{
>    AFX_MANAGE_STATE(_afxModuleAddrThis);
>
>    // Registers the type library with the Windows registration database
>    // and allows the type library to be used by other containers that are
>OLE-control aware.                 // This function updates the registry
>with the type library name and its location
>    //  on the system.
>    if ( ! AfxOleRegisterTypeLib ( AfxGetInstanceHandle( ), _tlid ) )
>        return ResultFromScode( SELFREG_E_TYPELIB );
>
>    AfxOleRegisterTypeLib ( AfxGetInstanceHandle(), _tlid, _T(
>"MyOLEServer.tlb" ) )
>
>    if ( ! COleObjectFactoryEx :: UpdateRegistryAll ( TRUE ) )
>        return ResultFromScode( SELFREG_E_CLASS );
>
>    return NOERROR;
>}
>
>Is there an option in PowerBuilder 5.0.3 or PowerBuilder 6 that adds
>DllRegisterServer function to generated by PowerBuilder OLE server DLL?
>Is there a utility from PowerSoft that solves that problem?
>What other options do we have to make OLE Server (ActiveX control) to work?
>
>I can see my OLE Automation object with "OLE Viewer".
>
>But when I tried to access this OLE Automation using ActiveX Server Page
>and VBScript - VBScript function was unable to create this object.
>Isn't PowerBuilder 6 should be able to create ActiveX?
>
>
>


0
Mike
11/13/1997 2:30:49 AM
Do you know any easy way to test it?
I 've got the right path in my .reg file and .tld file.
Those files have been generated with PowerBuilder 6.0
I've checked the .reg file though the editor. It looks OK.
The problem is - I can't access it through TCP/IP - using NT4.0 server, and
VB Script and ActiveX page.
I thought - that OLE automation object can be loaded same way as ActiveX
object. They are both based on COM. may be I am wrong. 
Do you know of any easy way to test it?

Mike Everett <michael@dialnet.net> wrote in article
<WKPn5J978GA.90@forums.powersoft.com>...
> Sounds like you might need to modify it's reg file for it's location.
There
> are two entries in it that set the path to the DLL - you can't miss them.
> 
> BTW once you do that just merge it with the registry. You don't need the
> regsvr32.exe program. If you want to automate that step I recommend
> InstallShield (a version of which is supposed to be included with the
final
> release of PowerBuilder)
> 
> me
> 
> 
> Yakov Soblev wrote in message <01bceee9$d752a6c0$63859f96@dunt1857>...
> >We are writing a PowerBuilder application that can be used as OLE
Runtime
> >Automation Server.
> >We are using PowerBuilder 6.0 beta 3.
> >
> >We've built a 32-bit .pbd and made it a DLL ( OLE server )
> >We've used PowerBuilder sample program PBGENREG.PBL to generate .reg and
> >tlb (type library) files.
> >We've installed PowerBuilder deployment on Windows NT 4.0 server and
tried
> >to register
> >it with the system using "regsvr32.exe" program.
> >
> >We are getting an eror message:
> >
> >"C:\MyOLEServer.dll was loaded, but the DllRegisterServer entry point
was
> >not found.
> >DllRegisterServer may not be exported, or corrupted version is in
> >memory..."
> >
> >DllRegisterServer() registers DLL type library with the system and
should
> >be generated by PowerBuilder.
> >
> >To be an ActiveX control , our DLL must be a COM object, export
> >DLLRegisterServer and DLLUnRegisterServer.
> >
> >// C++ code for that function
> >STDAPI DllRegisterServer( void )
> >{
> >    AFX_MANAGE_STATE(_afxModuleAddrThis);
> >
> >    // Registers the type library with the Windows registration database
> >    // and allows the type library to be used by other containers that
are
> >OLE-control aware.                 // This function updates the registry
> >with the type library name and its location
> >    //  on the system.
> >    if ( ! AfxOleRegisterTypeLib ( AfxGetInstanceHandle( ), _tlid ) )
> >        return ResultFromScode( SELFREG_E_TYPELIB );
> >
> >    AfxOleRegisterTypeLib ( AfxGetInstanceHandle(), _tlid, _T(
> >"MyOLEServer.tlb" ) )
> >
> >    if ( ! COleObjectFactoryEx :: UpdateRegistryAll ( TRUE ) )
> >        return ResultFromScode( SELFREG_E_CLASS );
> >
> >    return NOERROR;
> >}
> >
> >Is there an option in PowerBuilder 5.0.3 or PowerBuilder 6 that adds
> >DllRegisterServer function to generated by PowerBuilder OLE server DLL?
> >Is there a utility from PowerSoft that solves that problem?
> >What other options do we have to make OLE Server (ActiveX control) to
work?
> >
> >I can see my OLE Automation object with "OLE Viewer".
> >
> >But when I tried to access this OLE Automation using ActiveX Server Page
> >and VBScript - VBScript function was unable to create this object.
> >Isn't PowerBuilder 6 should be able to create ActiveX?
> >
> >
> >
> 
> 
> 
0
Yakov
11/25/1997 5:06:26 PM
Reply:

Similar Artilces:

Bugs and Problems when using ActiveX ole controls in PB 6/7/8
Hello, fellows, I am trying using ActiveX controls in PB6.5, but when I want to get the properties or call the methods of the activex control, I cannot get the correct string when working in Chinese envirnment. The data type of the properties and the methods of the activex control is string. I have no such problem when the string is english. I test this in PB7 and PB8 also, I have the same problem. I know that the ActiveX control is created by VC++ and in VC++, the data type of all these properties and method of the control is "BSTR". Infact, I think, every ActiveX c...

can i use pb's automation server to create an activex/ole/ocx? help me!
Please do not cross-post. -- <hopethishelps/> Roy Kiesler [TeamSybase] MySybase -- http://www.sybase.com/mysybase "tadsun" <tadsun@163.com> wrote in message news:UXo0Ru7BCHA.201@forums.sybase.com... > > > ...

OLE automation problems with PB 6.5.1
Since I installed PB 6.5.1 I have problems with OLE automation: I have an OLE control object called iuo_olectrl. I set the blob with iuo_olectrl.ObjectData = bl_Oledata (The blob can be a MS Word or Excel or Wordperfect document.) and start the OLE application with iuo_olectrl.DisplayType = DisplayAsIcon! iuo_olectrl.Activate (OffSite!) Everything worked fine with PB 6.5 EBF 595 and earlier EBFs and with PB 5.0.03 Since I installed PB 6.5.1. (version 620) the activate function returns with the error code -9. It only works if the application (Word or Excel) is a...

How to use method activeX control in PB (Newbie using ActiveX)
Hi all, This is the first time I'm using activeX in my application, does anyone can helpme with these problem. How to use method in activeX because I've got example that come with the ocx file only with VB6 and I don't know how to used it with PB7. ------------ Call ActiveX_name.CopyTable(filename As String,Creator As String,SDDI_plugin_name As String, CreateFlag As Integer, VersionMajor As Integer, VersionMinor As Integer) ------------ THX -- ebr ...

how can i use powerbuilder to develop an activex/ole/ocx? help me please!!!
Please do not cross-post. -- <hopethishelps/> Roy Kiesler [TeamSybase] MySybase -- http://www.sybase.com/mysybase "tadsun" <tadsun@163.com> wrote in message news:jIQ8Mt7BCHA.200@forums.sybase.com... > > > ...

Help using OLE from a PB executable (PB 6.5)
I copied this from a suggestion found in this NG on how to convert datawindow to Excel - by saving to HTML (to get computed fields etc), then converting to Excel format using OLE. When I run from within PB, it works fine - the file "docname" is in Excel format. But when I build the application and run from an EXE, the Excel logic doesn't seem to do anything - the resulting file still looks in HTML format. I am wondering if I need to add something to the Resource file to get this OLE to work from executable? The code is as follows (where "ds" is a DataS...

PB Ole Automation Problem
Hi, I am trying to access an user object through Ole automation. I can't access an instance variable of the user object, getting this error: "Cannot convert oleobject in Any variable to transaction at line ..." The user object has a function, of_connect(), that creates a transaction object and populate it. The transaction object is an instance variable. The client application has this code to access the user object through ole automation: OleObject u_tr integer li_status u_tr = CREATE OLEObject li_status = u_tr.ConnectToNewObject ("ConnectTran") IF...

ActiveX, OLE Automation, OLEStorage
1.) Does anyone know how to create an ActiveX control in PB 6.0 or 6.5? 2.) I have utilized OLE automation to use some functionality of Excel and Word. Unfortunately, whenever I use the ConnectToNewObject() or ConnectToObject() functions of an OLEObject variable, either the entire application of Word or Excel application is opened behind the scenes. This is the case even though I only want to use a single function within these applications. It seems like a waste to load the entire application to get just at simple functionality. Is it possible to open lightweight component applicatio...

ActiveX Controls, OLE Automation, OLEStorage
1.) Does anyone know how to create an ActiveX control in PB 6.0 or 6.5? 2.) I have utilized OLE automation to use some functionality of Excel and Word. Unfortunately, whenever I use the ConnectToNewObject() or ConnectToObject() functions of an OLEObject variable, either the entire application of Word or Excel application is opened behind the scenes. This is the case even though I only want to use a single function within these applications. It seems like a waste to load the entire application to get just at simple functionality. Is it possible to open lightweight component applicatio...

Welcome to the OLE-OCX-ACTIVEX newsgroup
Welcome to the OLE-OCX-ACTIVEX newsgroup. This is a forum for discussion on topics related to the usage of OLE, OCX and ACTIVEX with PowerBuilder. Feel free to post questions about the product, concerns about your development needs for enhancements and any other feedback. All posted messages will be in the public domain and may be republished on Powersoft's InfoBase CD ROM as well as on our WebSite in order to provide information that is extremely valuable to other developers. This is NOT Powersoft Technical Support and it is not the purpose of this newsgroup service to allo...

OLE automation to Excel using PB
I'm attempting to do a SaveAs to a different filetype by using OLE automation to Excel. The test code I am using is below: oleobject oo_test integer li_rc string ls_format oo_test = Create OleObject li_rc = oo_test.ConnectToObject( & "c:\van\expense.xls") IF li_rc = 0 THEN oo_test.application.workbooks(1).& worksheets(1).cells(1,1).value = 14 //oo_test.application.workbooks(1).save() oo_test.application.workbooks(1).SaveAs ("c:\van\van.txt", "xlText") Else Messagebox ("Error", li_rc) END IF ...

OLE automation problem (PB 5.0)
Hi All, I have created an automation server from a nvo and calling its function from VB. When i call a function which has some arguments passed by reference, i get an error saying that "Error: bad argument list for function/event : functionname". I get this error even if i call the function from PB (using automation method). When i replace the reference arguments and use Instance variables to pass back the results, i dont get an error. Is it a PB bug? If not how shall i pass a reference argument? Thanks, Deepak. ...

PB 6.5 with OLE, insertrow problems
Has any had this problem? I am running PB 6.5 and we converted a part of our framework and application so it can be executed via an OLE interface. When we execute the program via OLE, everything looks OK, except in the framework script an 'dw_xxx.insertrow(0)' statement fails to insert a row. I checked return code and it returns a zero(0), and there is no rows in the datawindow. Any ideas? -- Paul K. Watje AssetWorks, Inc. ...

PB 6 OLE object as IN-Process Server Problem
Hi ! I'm create IN-Process OLE Server from PB NVO with implementation of RDBMS logic. After compiling by PB5.0.03 I Can call this OLE Server from VB5, VBA from Office97 and Delphi3 code and explore this object by MS OLE Viewer 2.10. It's work fine. But after compiling same object from PB6 RC3 all of this programs call DrWatson (under NT) or show GPF info under Win95. What's happen? PS: DCOM Config utility show my new OLE Server (after compiling by PB6) as Remote Server Case sensitive. Make sure all your methods are lower case. -- Thanks Dean Jones, CPD Profes...

Web resources about - problems using OLE Automation and ActiveX in PB 6 - sybase.ole-ocx-activex

Automation - Wikipedia, the free encyclopedia
For a hierarchical presentation of automation topics, see Outline of automation . For other uses, see Automation (disambiguation) . Automation ...

Automation World - Covering the field of industrial automation
AutomationWorld.com delivers content for the Automation Buying team, which includes Information Technology and Networking; Operations and Engineering; ...

Facebook Ads API Partner AdStage: Campaign Automation, $6.25M Series A Funding
AdStage , a Facebook ads API partner, announced Wednesday the launch of campaign automation — as well as a $6.25 million round of Series A funding. ...

Mind blown! Facebook’s f8 makes a mobile move into marketing automation
... Thus, you’ll need to build a mobile app (if you’re enterprise) or use an app-building platform (such as GroSocial). The marketing automation ...

Automation Heroes (@automationhero) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Automation World
Automation World is your link to the why and how of manufacturing automation. The purpose of this group is to connect manufacturing engineers,... ...

Is home automation in your future or are you using it now?
Home automation gets touted by some as the future, but it's really the now. A seemingly endless list of products are on the market and they allow ...

Rockwell Automation Announces Mobility Co-Innovation with Microsoft
A new mobility co-innovation project by Rockwell Automation and Microsoft Corp. will be demonstrated at Automation Fair in Chicago Nov. 18 and ...

3 Growing Digital Trends for 2016: Automation, Personalization, Gamification.
1. Marketing Automation What is it? Marketing automation is a category of technology that allows companies to streamline, automate, and measure ...

Edimax lands networking device orders for production automation
... device maker Edimax Technology has obtained orders from US-based clients for about 25,000 wireless networking devices used in production automation, ...

Resources last updated: 12/19/2015 12:49:11 PM