Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 9 Monaten, 1 Woche
Letzter Beitrag:
vor 9 Monaten, 1 Woche
Beteiligte Autoren:
ech madriaga, Peter Holemans, Fabrice Harari

[WD] dynamic .net object not allocated

Startbeitrag von ech madriaga am 11.04.2017 13:56

Hi Coders,

Good day.
Can you help me how to solve the error "dynamic .net object not allocated"?
Any advice?

Thanks,
Ech

Antworten:

Hi

not without seeing the code creating the error, no...

best regards

von Fabrice Harari - am 11.04.2017 14:14
Hi Ech,

You need to call the constructor of the .Net object...

Sample to instantiate a dynamic .Net object in WL:

// In C# the first declaration would be:
// ClientContext context = new ClientContext(pURL);

// In WLanguage declaring DotNet objects would be done like this.
// You need to verify the available constructor signatures and identify how to instantiate them
// Starting with ClientContext, the constructor requires a URL to the
Context is Microsoft.SharePoint.Client.ClientContext(pURL)
Credentials is NetworkCredential(pUserName, pUserPassword, pUserDomain)
Context.Credentials = Credentials

// Get the requested list.
ResultList is Microsoft.SharePoint.Client.List dynamic
ResultList = Context.Web.Lists.GetByTitle(pListName)


All the best,

Peter Holemans

PS: Watch out however, there are many contraints integrating more advanced .Net stuff in WX (albeit the PCS marketing).
I can get the WDxxDotNet DLL to crash at will when integrating SPClient assemblies but am no longer spending time to report it to PCS.

von Peter Holemans - am 11.04.2017 15:07
Hello,

I am able to connect and perform an inventory on RFID Reader using windev but the collecting of Reading and Collecting of RFID Tag ID's are not displaying:

Here's the code from c#:


public partial class AppForm : Form
{
internal RFIDReader m_ReaderAPI;
----------------------------
public AppForm()
{
InitializeComponent();
m_ReadTag = new Symbol.RFID3.TagData();
-------------------------
private void myUpdateRead(Events.ReadEventData eventData)
{
int index = 0;
ListViewItem item;

Symbol.RFID3.TagData[] tagData = m_ReaderAPI.Actions.GetReadTags(1000);
if (tagData != null)
{
for (int nIndex = 0; nIndex < tagData.Length; nIndex++)
{
if (tagData[nIndex].OpCode == ACCESS_OPERATION_CODE.ACCESS_OPERATION_NONE ||
(tagData[nIndex].OpCode == ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ &&
tagData[nIndex].OpStatus == ACCESS_OPERATION_STATUS.ACCESS_SUCCESS))
{
Symbol.RFID3.TagData tag = tagData[nIndex];
string tagID = tag.TagID;



And Here's my windev code:

Main is object dynamic RFIDReader= new RFIDReader("169.254.1.1",5084,0)
//TAGS123 IS object DYNAMIC TagData = new TagData()
m_ScannerManager is object dynamic TagData = new TagData()

Main.Connect();

IF Main:IsConnected=True AND Ping("169.254.1.1") THEN
Main.Actions.Inventory.Perform()


m_opcode = ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ



clTagss is TagData = Main.Actions.GetReadTags(1000)

//tagg is TagData=clTagss

nTaggstring is int=clTagss.tagid
TableAddLine(TABLE_NoName1,nTaggstring)
Main.Actions.Inventory.Stop()
END



Thanks,

von ech madriaga - am 12.04.2017 13:45
Hi Ech,

Just had a quick look at your sample...
TagData is an array (See declaration in C#: TagData[] )

Next in the C# code the array is browsed:
for (int nIndex = 0; nIndex < tagData.Length; nIndex++)

And each tag from the array is processed within this iteration:
Symbol.RFID3.TagData tag = tagData[nIndex];

I don't see this happening in your WD code...

Cheers,

Peter Holemans

von Peter Holemans - am 12.04.2017 14:04
Thanks Peter. I will try that.

von ech madriaga - am 13.04.2017 05:49
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.