Solved

DWORD interpretation problem

Posted on 1997-01-20
1
438 Views
Last Modified: 2013-12-04
I am using VC 4.0, Win95, and doing some coding that uses TAPI functions.  I have a callback function (LineCallBack in TAPI) that has 3 generic DWORD params passed to it.  I have no problem receiving these values and using them except when one of the values is supposed to point to a string.  In this case the value I receive is huge and is pointing to nowhere. (I might point out that the values are being sent to my callback from some unknown lower level functions supplied in a DLL as part of an SDK.)

After reading the definition of DWORD, which says:  a 32-bit uint OR "address of a segment and its associated offset" I decided that my problem might be that, in this case, DWORD means the latter (isn't this 16-bit addressing? why?).  I need to know how to interpret this value so that I can find my string.

I hope this is enough info... thanks for any help.

0
Comment
Question by:tberrier
1 Comment
 

Accepted Solution

by:
jw011697 earned 100 total points
ID: 1300018
In 32 bit land, a DWORD can act as a normal pointer as there are no segments used in addressing, just a 32 bit offset.

In this case you should just cast the DWORD as (char *) and it will work fine as a string.

When you say 'pointing to nowhere', what do you exactly mean?

I just checked through all the TAPI replies that could be sent to this LineCallback function and couldn't find any that provide a string (this is fairly unusual for callbacks as strings require memory to be allocated for the purpose).

Try looking at the Line Device Message again and make sure you have the interpretation of the parameters correct?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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 gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now