I've worked with struct when I used WinINet DLL.  
Here's an exemple when I try to find a filename in an FTP session.

***CODE BEGIN
Binary findFiledata = new Binary(512); // WIN32_FIND_DATA struct
Binary dwContext = new Binary(4); // DWORD size

dwContext.word(0, 0);

// Here I pass the pointer to findFiledata
// the dll fills findFileData with WIN32_FIND_DATA struct
_ftpFindFirstFile.call(_intSessHandle, lpszSearchFile, findFiledata, 
0, dwContext);

// The file found is in findFileData, we just need to extract it
// I know that the file name is located at 0x2C in the struct and
// length is 260
info(substr(findFiledata.string(0x2C), 1, 260));
***CODE END

Since you cannot declare struct in Axapta the same way you can in C, 
it's a bit more work, but you can also create a class that will 
encapsulate all the struct management.

If you need more info about this, let me know.

Steeve...

--- In [email protected], "surfing2alien" 
<[EMAIL PROTECTED]> wrote:
>
> Hi Steeve,
> Thanks for your answer.
> In the meantime I have found the way to handle the message through 
> XML.
> And the speed is OK, but if it's possible todo faster I would be 
very 
> glad.
> So I read you were able to extract fields to a struct, from a DLL??
> Would you share some idea's or code with me?
> 
> Satch
> 
> --- In [email protected], "Steeve Gilbert" 
> <steeve.gilbert@> wrote:
> >
> > Hi,
> > 
> > I think the XML version will indeed be a bit slower, but unless 
> your 
> > code is heavily used, I don't think you'll see a difference 
between 
> XML 
> > and DLL call.  I've been able to use struct with DLL but not 
array.
> > 
> > If you want to extract data from your XML string, use XML helper 
> class 
> > (XMLDocument, XMLNode, XMLElement, etc...) and that should be 
easy 
> > enough.  Start with : 
> > 
> > XMLDocument xmlDoc = new XMLDocuement();
> > xmlDoc.loadXML(yourXMLString);
> > ...
> > check methods available in XMLDocument.
> > 
> > regards,
> > 
> > Steeve...
> >
>


Reply via email to