Solved

netbios(NCB)

Posted on 1999-01-26
3
483 Views
Last Modified: 2013-12-03
Calling netbios(NCB) in Win98 to send a broadcast over the
LAN using NETBEUI returns without error but doesn't send
the broadcast.
The same program runs properly under DOS 6.22 by using
int 5Ch. In Win98 I call netbios(NCB) instead.
Is there something to pay attention to ?
Thanks
 
0
Comment
Question by:mimicrosoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
stefanr earned 200 total points
ID: 1419278
By experience from Windows NT I suspect that you are using a LANA number that is not connected to the proper protocol on the other machine(s). There is one LANA number for each one of the installed network cards AND each protocol. There is no simple way of knowing which LANA number that corresponds to which card and protocol (at least programatically). Therefore you have to test all available LANA numbers, and then use the one(s) that works, or simply broadcast on all LANA numbers in turn (the 'ncb_lana_num' member in the NCB struct).
0
 

Author Comment

by:mimicrosoft
ID: 1419279
Thank you very much for your hint. I've found the right ncb_lana_num experimentally and my test-program runs properly now.
Do you mean retrieving the wanted ncb_lana_num by using the adapter-status-command could be the right way ?

Remark:
I've found a difference to DOS, because adding the same local
name to the name-table again returns a new ncb_num  and doesn't return a duplicate-name-error as expected.

Regards,

Gerhard
0
 
LVL 3

Expert Comment

by:stefanr
ID: 1419280
It is hard to know programatically which LANA number to use when communication with different machines, so the best way is to enumerate all possible LANA numbers using the NCBENUM command, and then send to all of them in turn. I'm not sure if it works on Windows 98 though.
If not, maybe sending to the numbers 0 to 16 or some other maximum value would work. You could perhaps test which numbers works by checking the return code. If it is NRC_BRIDGE it would mean that the LANA number is invalid. I think that the numbers are consecutive, so the first invalid number would exclude all higher numbers too.
I do not think that the NCBSSTAT command would be so useful in this case, since it is used when the LANA number is known already.
If you were using a stream connection instead of a broadcast, the method above could be refined further. After having found the valid LANA numbers, you can test which LANA number(s) that is actually connected to the remote application by doing some custom handshaking. Send a custom message to each one of the valid LANA numbers, and let the remote application send back a custom ACK message on the LANA number(s) on that machine where the message were received. Then you could select a single LANA number on each machine (the LANA numbers are most likely different on each one) to communicate between them.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question