Developer Support Forum
Articles and Tips: article
01 Feb 1998
The following questions and answers first appeared in the Novell Developer Support News Group Forum. For more information, please see the "Engineering Support Forums" link at http://developer.novell.com/support/. Thanks to the following Developer Support Engineers for their contributions: Jan Beulich Kevin Burnett Edward Ek Russ Lundberg Mary Mak Hans Wieser
Developer Support Forum
ASN.1 IDs
Q. What's the correct format for Asn1ID_T in the schema? The data type defines it as a series of up to MAX_ASN1_NAME octets, but I've seen it both as an array of little-endian 32-bit words (this is how NAL does it, but it is not very space-efficient and long ids could overflow) and as ASCII strings.
A. The Asn1ID_T structure is defined as follows in our SDK documentaiton:
Asn1ID_T Holds the ASN1 ID of an object Service: NDS Defined In: nwdsbuft.h Structure typedef struct { nuint32 length; nuint8 data[MAX_ASN1_NAME]; } Asn1ID_T; Pascal Structure Defined in nwdsbuft.inc pAsn1ID_T = ^Asn1ID_T; Asn1ID_T = Record length : nuint32; data : Array[0..MAX_ASN1_NAME-1] Of nuint8 End;
The nuint8 data[MAX_ANS1_NAME) is basically a 32 unsigned int array. This is Novell's spec. You pass something in to this and you can get it back.
What I would suggest that you do is pass in, byte by byte, the value generated by an ASN 1 generator. Whether you use the Motorola format or the Intel format is your choice, since I don't know of any Novell utilities that currently use this.
Q. I am not sure what you mean by an ASN.1 generator. If you mean it should be stored in BER format, NAL does not do this. ASN.1 doesn't know anything about Motorola or Intel formats.
A. Correct. IMO it is a series of integers in whatever local representation. Actually, of course, it is not us who owns the ASN.1 specs, but ISO CCITT. I have searched through their docs at DSInternic.net to see if I could find what the ID was supposed to be, but I never got beyond the OBJECT_IDENTIFIER type.
Q. What's the point of this field anyway?
A. Think of all possible class definitions to reside in a common tree. The ASN.1 ID gives the path from the root to the class definition. NDS in its current form does not support or use the IDs. Some network management tools do, however. You may find the ID in a MIB for a device.
C3PO Guide
Q. Is there a "Beginner's Guide to Developing C3POs"? I have the GW5 SDK documentation, but I was looking for something a little easier, with better examples.
A. C3POs are rather complex--it is the nature of the beast with COM. However, there is a VB 5 example and a Delphi example at this URL: http://developer.novell.com/support/sample/areas/groupwise.htm. These samples, which can be downloaded and used, have three steps that add code to cause the C3PO to do something. The sample adds a menu to launch the Windows calculator. It also has menus to show or hide a dialogue that displays message and C3PO function-call information.
C3PO Sending Mail
Q. I have written a C3PO linked to a Delphi app. The app adds a new folder called "Work Requests" and traps the events for the folder (through icons and menu options). When you insert a new message (it is based on a message folder), it starts up the Delphi code and the data is stored in a Paradox table. A field is added to the message that corresponds to the Paradox record. All of this is functioning correctly--except that I need to be able to send the message to a recipient. At the moment, all messages are created and then stored in the creator's folder--the Delphi app lets you select a name (from its own database, not GroupWise), and I need to turn this into the recipient information.
A. The recipient either needs to be--
the same as a GroupWise Display name, in which case you use Recipients.AddByDisplayName ("First Last"), or
a valid GroupWise E-mail name, like UserID@domain.postoffice, in which case you would use Recipient.Add ("EmailAddress").
GroupWise Filter vs. Query
Q. I am trying to port a macro I wrote that made a GroupWise 4.x client act as a pager gateway ( I really miss macros - they were so good & powerful!!) to a Delphi app. I am having some difficulty figuring out the difference between a filter & a query & how to use each. All I really want is a list of incoming items in mailbox folder with date <= today. I've seen a couple examples of queries in this group ( as well as performance considerations :( ) & was wondering if anyone could enlighten me on the use of filters. Trying ( hard - really!!) to move from macros to RAD.
A. Filters generally work faster than a Query because Query always assumes their are no indexes and filters take advantage of the indexes if they exist. This is an internal system operation that there is little control over. Indexing mechanism by default is set to run every 4 hours. This can be changed to run constantly, but this can be a drain on the server.
If the system has not been indexed then Query and Filter would work the same.
Q. Thanks for the info. Now, not that I want you to do my homework, but how do you use the blamed things? Here is an excerpt of my macro code:
( Psuedo - create a filter showing recieved items from today to 2 weeks from now, get list, count list ) hFilter = FilterCreate(Inbox!) FilterSetDateRelative(Handle: hFilter; DateType: BeginDatetime!; StartDate: Today!;;Today!;14) FilterApply(Handle: hFilter; ApplyTo: Itemlist!) //While(macroState = "On") iHandle := ItemlistCreate(;hfilter;) tnum := itemListGetCount(ihandle) .......
I looked at the token commander like you suggested, but it is kind of painfull when you have to pass handles & such--plus the client has to be running. So I would really like to try and use the object API.
A. Take a look at gw5xob44.exe which is a query sample. It is written in Delphi 3. It will give you the information you need to construct the query and perform the query. You can download this sample from URL
http://developer.novell.com/support/sample/areas/groupwise.htm.
Also take a look at the Objapi.htm documentation for the Object API. And select Filter Expression Syntax. This will give some examples that can be used for filter and query expressions.
Brief description of Query. You can create a query from the Account.CreateQuery(<expression<) method. Or you can use filters using several different objects. The object collections are the ones that will have some time of Find method to use. Messages.Find would be one example.
GroupWise Problem
Q. My initial problem involves attaching a file to a mail message via DDE tokenization. My code works in GroupWise 4.1 but causes a couple of strange things in GroupWise 5. Here is a copy of the code:
channel = DDEInitiate("GroupWise", "Command") DDEExecute channel, "NewMail ()" DDEExecute channel, "ItemSetText (" + Chr$(34) + "X00" + Chr$(34) + "; 0; " + Chr$(34) + Recipient$ + Chr$(34) + "; 0)" DDEExecute channel, "ItemSetText (" + Chr$(34) + "X00" + Chr$(34) + "; 9; " + Chr$(34) + dlg.Title + " for " + dlg.Subject + Chr$(34) + "; 0)" DDEExecute channel, "ItemSetText (" + Chr$(34) + "X00" + Chr$(34) + "; 10; " + Chr$(34) + "Please review the attached NEPA document." + Chr$(13) + Chr$(13) + "This document was created using the NEPA Document Approval And Routing Process." + Chr$(34) + "; 0)" DDEExecute channel, "ItemAttachmentAdd (" + Chr$(34) + "X00" + Chr$(34) + "; 114; " + Chr$(34) + ActiveDoc$ + Chr$(34) + "; " + Chr$(34) + dlg.FileName + Chr$(34) + ")" DDETerminate channel
The ItemAttachmentAdd command does not work in GroupWise 5.1--no file attaches. I've tried getting an error result back, but there is none. I've also tried using the following command in its place, but with the same result:
DDEExecute channel, "AttachmentAdd (" + Chr$(34) + ActiveDoc$ + Chr$(34) + ")"
A. The attachmentAdd doesn't work with GroupWise 5.2 32-bit version. A report has been logged on this. However, there is a sample Object API application that can be used to accomplish the same purpose, but doesn't require GroupWise Client to be loaded. Go to URL http://developer.novell.com/support/sample/areas/groupwise.htm and download gw5xob27.exe. This is a VB application that uses the Object API to send messages.
You can also download gw5xob32.exe, which uses both the Token Commander and the Object API to popup and GroupWise SendMail Dialog that has an attachment initially included with the SendMail Dialog when needed.
NWLoginToFileServer Return Codes
Q. I have a C application that uses the C interface and the NWLoginToFileServer function to log in a Windows NT machine (running the August '97 client) to a NetWare 3.12 file server. Most of the time it works fine. However, I have a customer who gets a hex 0xC0000140 return code when he runs this during the night. Since we've had problems with the NetWare Requestor on the first login, we detach from the server and attempt the login again. The second time it returns a 0xC000020C return code. I can't find documentation for these return codes. The customer does not have access to a LANAnalyzer. Can you help?
A. What you see are status codes that are passed from the transport layer to the NetWare client. C0000140 is defined as STATUS_INVALID_CONNECTION, and C000020C is defined as STATUS_CONNECTION_DISCONNECTED. Engineering has plans to remove these passed-through values and properly translate them (which also assumes you are always using the latest client version).
OBJAPI Documentation
Q. I am a Pascal and C/C++ developer looking for additional documentation for OBJAPI (besides what is available on the SDK).
A. We currently do not have additional documentation for the Object API, but we do have several examples of using different objects in Delphi and VB. Please check the following web site for more information: http://developer.novell.com/support/sample/areas/groupwise.htm
Setting Current Message Via MESSAGEID
Q. I have the messageid of a message and now want to set it as the active message so I can call other tokens to act on it. How do I change the current selected message to another message based on a messageid?
A. Use ItemOpen ("<messageID string<"), which will bring the message view to the foreground.
Station MAC Address
Q. Is there an API call to obtain a workstation's MAC address?
A. Yes, it is NWGetInetAddr. The MAC address is the nodeAddress parameter of NWINET_ADDR returned by the function.
Win95 Client 32 Documentation
Q. Where can I find a list of changes or revisions to Win95 Client32?
A. At present there is not such a list available to the public. However, the Client32 team will soon have an online forum. In addition, if you have a specific file locking bug report on the latest Client32, please open an incident with Technical Support (800-NetWare).
Copyright 1998 by Novell, Inc. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording, for any purpose without the express written permission of Novell.
All product names mentioned are trademarks of their respective companies or distributors.
* Originally published in Novell AppNotes
Disclaimer
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.