web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Unable to cast object of type 'System.String' to type 'System.IntPtr'

(0) ShareShare
ReportReport
Posted on by

I am trying to add detail grid for a custom table xBillable, but get this error on form load. Anyone can help me? Thanks.

 

System.InvalidCastException was unhandled   Message="Unable to cast object of type 'System.String' to type 'System.IntPtr'."   Source="Solomon.Kernel"   StackTrace:        at Solomon.Kernel.Exports.DetailSetup(Int16 , Object , Object , SolomonDataObject , Object , Object , Object )        at ST26000.VBTools.DetailSetup(Int16 Cursor, SAFGrid SAFGridCtrl, Object AutoLineNbfFld, SolomonDataObject& bTable1, Object& bTable2, Object& bTable3, Object& bTable4) in )        at ST26000.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81   InnerException:

   

Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

Call ApplInit()

       

Call SetAddr(LEVEL0, "bCustomer", bCustomer, nCustomer)       

Call SetAddr(LEVEL1, "bXBillable", bXBillable, nXBillable)

      

Call SqlCursorEx(csr_Customer, LEVEL0, "csr_Customer", "Customer", "Customer")       

Call SqlCursorEx(csr_XBillable, LEVEL1, "csr_XBillable", "XBillable", "XBillable")

       

Call ScreenInit()

        mh_xBillable = DetailSetup(csr_XBillable, SafGrid1, bXBillable.LineNbr, bXBillable, PNULL, PNULL, PNULL)

   

End Sub

 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    The error id gone after I used

    bXBillable.AddressOf("LineNbr")

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans