Solved

DWORD interpretation problem

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

729 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