Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

netbios(NCB)

Posted on 1999-01-26
3
Medium Priority
?
486 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 800 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

721 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