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

x
?
Solved

Typecast a pointer to a DoubleWord ? for WinHelp API call

Posted on 1999-07-27
4
Medium Priority
?
170 Views
Last Modified: 2010-04-04
I'm trying to fire a WinHelp 4 macro using the winhelp api function and it requires the address of the string representation of the macro name as a doubleword. I'm completely stuck, I'm new to pointers and memory addressing so my own efforts are fruitless.

I know it must be really easy ?

Darren
0
Comment
Question by:elkiors
[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
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
simonet earned 200 total points
ID: 1391407

you can typecast the string to a PChar and the typecast that as a longint or DWord. Here's an example:

WinApiHelpFunction(DWord(pchar('My string')));

Yours,

Alex
0
 

Author Comment

by:elkiors
ID: 1391408
Simonet,

Thanks, I never realised typecasting was so easy ! I accept it's one of those 'handle with care' concepts though.

Darren
0
 
LVL 15

Expert Comment

by:simonet
ID: 1391409
It's quite easy. Just remember that all pointer types (pchar, object variables and all ^variable) are longints.

Yours,

Alex
0
 

Author Comment

by:elkiors
ID: 1391410
Thanks

See you on another thread

Darren
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

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