Cannot Create ActiveX component  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Cannot Create ActiveX component

Postby Riyaz » Fri Nov 29, 2019 1:32 pm

Hi There

Am trying to call our custom dll through the plugin in v7.2.1 but getting the attached error, pls see the code snippet below that am using, FYI, have kept the custom dll in the Jiwa Financials folder and its referenced in the plugin.

Try

PickSlip = CreateObject("AtronicsEDIClassLibrary.PickSlip")

With PickSlip
.JiwaConnectionString = CStr(salesOrderForm.SalesOrder.Manager.Database.ConnectionString)
.DatabaseName = salesOrderForm.SalesOrder.Manager.Database.DatabaseName
.UserName = salesOrderForm.SalesOrder.Manager.Database.JiwaLoginUserName

.Initialize
.SendPS

If .Message <> "" Then
MsgBox("Error creating warehouse pick slip: " & .Message)
End If

End With
PickSlip = Nothing
salesOrderForm.Refresh ()

Catch ex  As Exception 
MsgBox(ex.Message+ex.StackTrace )
End Try
Attachments
Screen Shot 2019-11-29 at 7.26.44 am.png
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Cannot Create ActiveX component  Topic is solved

Postby SBarnes » Fri Nov 29, 2019 5:40 pm

That error would indicate that AtronicsEDIClassLibrary.PickSlip can not be resolved to the underlying CLSID in the registry which would either indicate the dll is not registered on the machine or you don't have execute permission, more likely the first.

If it's you own DLL and code I would suggest you either migrate the code to inside the plugin or migrate it to a .net class library that can then be added as an embedded reference and will automatically deploy with the plugin and do away with COM completely unless there is a specific reason it needs to remain COM based.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Cannot Create ActiveX component

Postby Mike.Sheen » Fri Nov 29, 2019 6:20 pm

I concur with Stuart.

If you absolutely must use this COM object, I'd first start with a small, one line .NET console application containing the line of failure:

Code: Select all
PickSlip = CreateObject("AtronicsEDIClassLibrary.PickSlip")


Once you get that working it should work within a Jiwa plugin.

To get that small console application working - as Stuart mentioned - that component needs to be registered - if it is not already. You register COM dll's by using the Microsoft command line tool, regsvr32. Just Google that to find articles / guidance on how to use that.

Also all COM dependencies that dll uses will also have to be registered, or you will arrive at the same error.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Cannot Create ActiveX component

Postby SBarnes » Sat Nov 30, 2019 8:13 am

You may find this tool helpful if there are dependencies http://www.dependencywalker.com/
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Cannot Create ActiveX component

Postby Riyaz » Wed Dec 04, 2019 10:15 pm

Thanks both

The custom app along with has been installed on the server, registered with the regasm and also referred the dll in the plugin, but still get that activex error.

Any further recommendations pls
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Cannot Create ActiveX component

Postby SBarnes » Wed Dec 04, 2019 10:33 pm

When you say you used regasm did you use the 64 bit or 32 bit version see https://stackoverflow.com/questions/372 ... r-regsvr32

Also if you have the source code I would go back to my original suggestions of porting the code, long term this probably the best option.

My only other suggestion is if this is a COM DLL that was created in visual basic 6 you may need to install the the vb6 runtime

You may also need to ensure that the user that this is executing under has permissions to where the DLL is
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Cannot Create ActiveX component

Postby Mike.Sheen » Wed Dec 04, 2019 10:55 pm

Riyaz wrote:The custom app along with has been installed on the server, registered with the regasm


I don't think you don't want Regasm. I thought Regasm was to make .NET assembly able to be called from COM. This is the opposite of what you want.

From the docs on Regasm:
The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently


You can call a COM dll from .NET using the CreateObject method if it is registered - and to register a COM dll you need to use Regsvr32.

If you provide a sample .NET project trying to call the COM dll along with the COM dll itself, I might have a chance in working out what you need to do. If you don't want to post it here, you can create a service issue on our helpdesk and provide the necessary resources and I can look at it.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Cannot Create ActiveX component

Postby SBarnes » Fri Dec 06, 2019 7:03 am

I would still port the code in the long run this would make life easier
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1618
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Cannot Create ActiveX component

Postby Scott.Pearce » Fri Dec 06, 2019 8:19 am

SBarnes wrote:I would still port the code in the long run this would make life easier


Absolutely agree with this.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Cannot Create ActiveX component

Postby Mike.Sheen » Fri Dec 06, 2019 6:13 pm

SBarnes wrote:I would still port the code in the long run this would make life easier


Even if you no longer have the source code to port, it would be a huge benefit to re-create the logic in .NET - either as a class library or just as a plugin. Doing so reduces your technical debt - once you accrue enough of that debt, it'll find a way to make you pay that debt at the most inconvenient time - so better to be proactive and do it sooner.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron