Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB to VFP -- PT_STRING8 conversion? 1

Status
Not open for further replies.

IForgot

Programmer
Mar 20, 2002
122
US
I am attempting to convert some VB code into VFP7 and I could use some advice.

One line of code wants me to do an OR with a Hex value and end up with a value in the PT_STRING8 format.

I can do the OR with BITOR()
and I can certainly to the numeric-to-string conversion with STR(),
but I have no idea how to get the numeric value into the PT_STRING8 format.

The definitions that I have found so far are:
PT_STRING8 /* A null terminated 8-bit character string */
PT_STRING8 should be set to string value containing 8 bit characters only
but that definition, by itself, is not helping me.

If this is a use of STRCONV(), then what parameters are necessary to get to PT_STRING8?

Your assistance would be greatly appreciated.

Thanks,
I_Forgot
 
Based on the description alone, this is nothing more than a string that is teminated by a chr(0). e.g.
Code:
VFP_String8 = "Now is the time ..."+chr(0).
Many Win32 API calls require null terminated strings because there is no "length", and so Windows scans to find the end of the string - the chr(0)!

However without the code it's difficult to guess what the "OR" stuff is all about!

Rick
 
I don't know what the specific code lines you are having
problems with are, but I'm assuming since you are
referencing a PT_STRING8, it's for some type of MAPI call.

If you provide the VB line(s) in question maybe we could
be of more help.

Darrell
 
Darrell - you are correct, the code is part of a MAPI call used within Redemption to change the TO: "name" to something other than the Outlook Default Account.

Rick - Your answer seemed to do the trick.

For reference, the working code ended up looking like the following:
oRedem = CREATEOBJECT("Redemption.SafeMailItem")
oOutlook = CREATEOBJECT("Outlook.Application")
oMail = oOutlook.CreateItem(0)

oRedem.ITEM = oMail
FromTag = oRedem.GetIDsFromNames("{00020386-0000-0000-C000-000000000046}", "From")
FromTag = BITOR(FromTag, 0x1E) && VFP Version
FromTag = ALLTRIM(STR(FromTag,20)) + CHR(0) && Convert to String - PT_STRING8 Format

WITH oRedem
.ITEM = oMail
.TO = mcEmailAddr
.FIELDS[FromTag] = &quot;Sender Name <Sender@MyISP.com>&quot; && Insert Alternate FROM:
.ReplyRecipients.ADD(&quot;Reply Name <Reply_To@MyISP.com>&quot;) && Insert Alternate REPLY-TO:
.Subject = mcSubject
.Importance = IMPORTANCELOW
.Body = mcBodyMsg
.Attachments.ADD(mcAttach1) && Fully Pathed Attach File #1
.Attachments.ADD(mcAttach2) && Fully Pathed Attach File #2
.SEND
ENDWITH

* --- When Done, RELEASE The Objects ---
RELEASE oMail
RELEASE oOutlook
RELEASE oRedem

The code now works well.

Thanks,
I_Forgot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top