Solved

DWORD interpretation problem

Posted on 1997-01-20
1
440 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Mobile 6.5 device Apache Flex 3 44
MS Access (Newest One): Pulling Data out of a MS SQL DB 1 45
Windows Process running 3 48
Best way to accomplish this task? 3 86
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 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

12 Experts available now in Live!

Get 1:1 Help Now