Solved

DWORD interpretation problem

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Enable Clear Text in Win 8.1 7 47
Query performance - SQL Server 20 85
Clean Uninstall of VS Professional 2015 5 60
WPF issue with Trigger 2 130
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…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 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