Hi All
I am trying to connect to a "Interop.Assembly" with dot net .
The assembly registers with success and I can see the all the dotnet methods, classes, types on the editor's auto complete list.
This API needs to authenticate a password given to me by the "Sage" the publisher of the software.
The password is accepted and I get passed the login . A pointer to the application is assigned with no error.
But the code fails when I try use the application pointer with a method that is in the auto complete list.
I can see the method "CreateImporter()" in the Name_Space but the error comes back as "Method CreateImporter not found".
Here is the code:
I appreciate any help .
Thanks Nick.
I am trying to connect to a "Interop.Assembly" with dot net .
The assembly registers with success and I can see the all the dotnet methods, classes, types on the editor's auto complete list.
This API needs to authenticate a password given to me by the "Sage" the publisher of the software.
The password is accepted and I get passed the login . A pointer to the application is assigned with no error.
But the code fails when I try use the application pointer with a method that is in the auto complete list.
I can see the method "CreateImporter()" in the Name_Space but the error comes back as "Method CreateImporter not found".
Here is the code:
Code:
dim Sv as DotNet::Services dim assy as DotNet::AssemblyReference assy.FileName="C:\Program Files (x86)\Sage Software\Peachtree\Interop.PeachwServer.dll" if .not. file.exists(assy.FileName) then ui_msg_box("can't find file",assy.FileName) end end if if sv.RegisterAssembly("",assy) then if sv.CallResult.Success then dim ologinselect as dotnet::Interop::PeachwServer::LoginSelectorClass new LoginSelectorClass() dim ologin as dotnet::Interop::PeachwServer::Loginclass new ologinselect.GetCurrentLoginObject() if ologin<>null_value() then dim app as dotnet::Interop::PeachwServer::IApplication=ologin.GetApplication("Company name","password12345987") if app=null_value() then ui_msg_box("Application Error","Application pointer empty") end end if '***** The error comes in the next line "Method app.CreateImporter not found" dim importer as dotnet::Interop::PeachwServer::Import = app.CreateImporter(dotnet::Interop::PeachwServer::peachwieobj::peachwIEObjSalesJournal) app.ExecuteCommand("exit|file") else msgbox("error2","Ologin failed") end end if else msgbox("error1","selector failed") end end if else ui_msg_box("Assembly register failed!",sv.CallResult.text) End if
Thanks Nick.