Replacement for StrPtr ?

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

I've searched my help files, and all I can find is that the StrPtr() function is
not supported.

Is there a suitable replacement in VB.Net?
 
Tim said:
I've searched my help files, and all I can find is that the StrPtr()
function is not supported.

Is there a suitable replacement in VB.Net?

What do you need it for? If you let us know, we can point you to the
correct method to do what it is you need to do....

Tom Shelton
 
Hi Tim,

You can doubt if this is a subject for this newsgroup. On the other hand I'
ve seen an answer from Herfried to Ashok where Herfried did write.
Please post the complete VB6 declaration of 'EbExecuteLine'. Why do you
use this function?!
So maybe he can help you when you send that.

Did you know there is a special newsgroup for dotnet vb upgrade questions?
(I thought Herfried was active in that newsgroup too).
Maybe you can get a quicker answer there.

Mostly Herfried looks for the messages about 11:00 or 12:00 GMT, but it is
Sunday in Europe so I don't know if that will be today.

I hope you get your answer.

Cor
 
Hi Tim,
I was writing this while you got your answers.
Happenly a lot faster and better than yesterday.
Cor
 
Hello,

Cor said:
You can doubt if this is a subject for this newsgroup.

I think it is...
Mostly Herfried looks for the messages about 11:00 or 12:00
GMT, but it is Sunday in Europe so I don't know if that will be
today.

;-)

I hope Tim posts the code he wants to convert.
 
Hello,

Tim said:
Well it's just a small program I've written in VB6 for my work.
I know I could take my time and create a REAL one, but
I've been using an InputBox() to get a response from someone,
and I was using the StrPtr() method to detect if the user
was pressing Cancel rather than pressing Enter

That's not supported by the VB.NET 'InputBox' any more.

You may want to implement an input box on your own:

http://groups.google.de/[email protected]
 
I have the same issue to resolve. Here is relevant code that requires modification:

lngResult = CoCreateGuid(udtGUID) ' Create a 'raw' GUID
If lngResult = GUID_OK Then
strFormattedGUID = New String(Chr(0), GUID_LENGTH + 1)
' Convert the 'raw' GUID to a formatted string
'UPGRADE_ISSUE: StrPtr function is not supported. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1040"'
StringFromGUID2(udtGUID, StrPtr(strFormattedGUID), GUID_LENGTH + 1)
Else ' Either return nothing or find some way to handle the error
strFormattedGUID = Right(Space(GUID_LENGTH) & VB6.Format(Now, "yyyymmddhhnn") & VB6.Format(GetTickCount(), "000000000000"), GUID_LENGTH)
End If
CreateGUIDKey = Left(Trim(strFormattedGUID) & Space(GUID_LENGTH), GUID_LENGTH)

Brenton

From http://www.developmentnow.com/g/38_2003_9_0_0_226413/Replacement-for-StrPtr-.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Brenton Norman said:
lngResult = CoCreateGuid(udtGUID) ' Create a 'raw' GUID
If lngResult = GUID_OK Then
strFormattedGUID = New String(Chr(0), GUID_LENGTH + 1)
' Convert the 'raw' GUID to a formatted string
'UPGRADE_ISSUE: StrPtr function is not supported. Click for
more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1040"'
StringFromGUID2(udtGUID, StrPtr(strFormattedGUID), GUID_LENGTH
+ 1)

How does the declaration of 'StringFromGUID2' look like?
 
Back
Top