• TI Thinks Resolved

Problem with Bq80xRW instantiation in C#,urgently!

Prodigy 110 points

Replies: 22

Views: 567

Development environment: windows10, 64-bit
According to the "EV2300 Customer Kit" information, the VB6.0 version of the EV2300 communication program has been written and tested and determined to be usable.
But in the same way that VB6.0 was developed using vs.net2015 C#, I encountered several problems:
1. After adding the COM component to the toolbox, the vs crash crashes directly when dragging to the Form form, and is also the same in vs2012.
2, BQ80XRWLib.Bq80xRW Bq80xRW1=new BQ80XRWLib.Bq80xRW (); such instantiation is an error
3, view online information, such as: AxBQ80XRWLib.AxBq80xRW Bq80xRW1 = new AxBQ80XRWLib.AxBq80xRW ();
Instantiation succeeded, but execution exception, bq80xrwName.GetFreeBoards(1, ref nReturn, ref dev_name);
prompt:
"An exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown."
Added this code,
System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
host.Child = Bq80xRW1;
Gd_Main.Children.Add(host);

Or this way of writing:

((System.ComponentModel.ISupportInitialize)(this.Bq80xRW1)).BeginInit();
this.Controls.Add(Bq80xRW1);
((System.ComponentModel.ISupportInitialize)(this.Bq80xRW1)).EndInit();

Error reporting when running to Gd_Main.Children.Add(host):
An unhandled exception of type "System.AccessViolationException" occurred in System.Windows.Forms.dll
Additional Information: An attempt was made to read or write to protected memory. This usually indicates that other memory is corrupted

I have tried a lot of methods, I have been working for a few days, there has been a problem with the instantiation of Bq80xRW in C#.

I am very anxious, please provide specific feasible methods or sample code DEMO, thank you!

  • In reply to Batt:

    How to download it, I am very anxious, because this problem has delayed the progress of the project. And other link addresses in the forum are available for download, for example: e2e.ti.com/.../3755.EV2300-Customer-Kit-_2800_1_2900_.zip . Can I provide a download address in this way? Or other effective download methods, thank you.

  • In reply to user6122185:

    I can't attach the file here. It's 48MB and the max size allowed here is 20000KB. Please find a way to download from that link.

    Regards,

    Batt.

  • In reply to Batt:

    The attachment address you gave (txn.app.box.com/.../pxt7h1fh79oc6nbugom20bms9pv3q7lb) can't be accessed by me or anyone else, showing "page not accessible". Can I provide another valid address? Or separate these files into several compressed files to provide downloads? There is no other way, this is a hope we have seen, please support it, thank you very much!

  • In reply to user6122185:

    See if this works, I have attached 5 files. Please remove the .zip extension from the .005, .002, .003, and .004 files. Please use 7-zip to extract.

    bqToolsSDKb20180726-1.0.2-windows-installer.zip.001.zip

    Regards,

    Batt.

  • In reply to Batt:

    Thank you very much for your help. Now you have downloaded and installed bqToolsSDK. Because I am very unfamiliar with C language, I am programming with C#. I tried to add references (such as: bqSBB.dl, bq80xrw.dll, bq80xusb.dll, bqzReader.dll, CMAPI.dll) to the project, but none of them succeeded. . How do I call the API like VB (bq80xrwName.GetFreeBoards and bq80xrwName.OpenDevice to open the device, bq80xrwName.ReadOneWire and bq80xrwName.WriteOneWire to read and write HDQ data) to quickly develop read and write data? I look forward to your help again.

  • In reply to user6122185:

    I have forwarded this request to the internal tools team. They will reply here if they can help you

    Regards,

    Batt.

  • In reply to Batt:

    Hi,

    Unfortunately our tools engineers are not able to provide you instantiation examples. Therefore we are unable to help you here. Please check other forums or on google for help with this issue.

    Regards,

    Batt.

  • In reply to Batt:

    I would like to express my sincere gratitude to you for your kind help. If you can't provide DEMO, can you tell me the idea of implementing the above API in detail? Otherwise I really don't know how to start.

  • In reply to user6122185:

    Hi,

    Unfortunately I'm not a software engineer. I only know the tools used here. The sdk has example code. You may want to see if there are posts for bqtoolssdk and the programming language you are trying to use.

    I'm really sorry that I'm not able to be of more help to you.

    Regards,

    Batt.