How to obtain a pointer of string variable

A

Ashok

Dear Sir,

I used a API call EbExecuteLine of VBA6.dll. It have a
parameter pStringCode (Pointer of a String). For this i
used StrPtr() function. It is working in my project. But
when i make setup program of this project and install it
to another system it gives an error "This Program Perform
An illigale operation".
Please help me how can I eleminate it.

Thanks

Ashok Maheshwari
 
H

Herfried K. Wagner [MVP]

Hello,

Ashok said:
I used a API call EbExecuteLine of VBA6.dll. It have a
parameter pStringCode (Pointer of a String). For this i
used StrPtr() function. It is working in my project. But
when i make setup program of this project and install it
to another system it gives an error "This Program Perform
An illigale operation".

Please post the complete VB6 declaration of 'EbExecuteLine'. Why do you use
this function?!
 
A

Armin Zingler

Ashok said:
I used a API call EbExecuteLine of VBA6.dll. It have a
parameter pStringCode (Pointer of a String). For this i
used StrPtr() function. It is working in my project. But
when i make setup program of this project and install it
to another system it gives an error "This Program Perform
An illigale operation".
Please help me how can I eleminate it.

The StrPtr function does not exist anymore in VB.NET. This is a VB.NET
group. For older versions please turn to one of the microsoft.public.vb.*
groups.
 
F

Fergus Cooney

Armin,

If he was using an older VB why would he complain that StrPtr is missing?

Please mark these irrelevancies as OT? ;-)

Regards,
Fergus
 
C

Cor

Hi Fergus,
Up again, was not so late last night I saw as usual (In this newsgroup)..
Oeps I almost forgot OT
Cor
 
A

Armin Zingler

Fergus Cooney said:
Armin,

If he was using an older VB why would he complain that StrPtr is
missing?

If he was using VB.NET, he wouldn't write "It is working in my project".
But you are right, I ignored "VBA6.dll" - probably because I couldn't image
that anybody would ever do this to a VB.NET application. :)
Please mark these irrelevancies as OT? ;-)

If you would mark yours with OT, I could add a filter saving 66.6% of my
download time. ;-)
 
H

Herfried K. Wagner [MVP]

Hello,

Cor said:
Up again, was not so late last night I saw as usual
(In this newsgroup).. Oeps I almost forgot OT

Do you always add "OT" to off topic posts now?
 
H

Herfried K. Wagner [MVP]

Hello,

Armin Zingler said:
If he was using VB.NET, he wouldn't write "It is working in my project".
But you are right, I ignored "VBA6.dll" - probably because I couldn't image
that anybody would ever do this to a VB.NET application. :)

I could not even get this function work correctly with VB6.
 
C

Cor

Hi Herfried,
I try and the OT you asked, if it was EOT was OT, I had done an OT message
to you.
Cor
 
F

Fergus Cooney

Hi Armin,

At least in the chat there's the possibility of a laugh and some fun.
These redirections, though, ... :-(

Actually, I think you should use TC for Traffic Control, or PD for Police
Duties, GL for Get Lost, or something. ;-)

Regards,
Fergus
 
H

Herfried K. Wagner [MVP]

Hello,

Cor said:
I try and the OT you asked, if it was EOT was OT, I had done
an OT message to you.

I don't really understand you.

EOT = End Of Thread
OT = Off Topic
 
C

Cor

Herfried,
EOT = End Of Thread
OT = Off Topic

Yes I know, but you had asked me last night if I did mean EOT when I had
written OT, and it was not.
I had special used OT. And because I did want to have the thread an EOT, I
did not answer you.
:)) little things are the most difficult to explain.
Cor
 
A

Armin Zingler

Fergus Cooney said:
At least in the chat there's the possibility of a laugh and some
fun.
These redirections, though, ... :-(

Actually, I think you should use TC for Traffic Control, or PD
for Police
Duties, GL for Get Lost, or something. ;-)

You should quote what you are referring to. I don't understand you, but,
don't worry, I don't have to. :)
 
C

Cor

Hi Fergus,

Let's not make it to serious.
Armin is not the one for non serious things, let's reminds us that.
I did make that same mistake yesterday.
He is giving a lot of help here and tries to do it very good.
But he has his strict rules and does it according that rules.
(Although Armin changes them little by little in a direction we like)
We have to give him time and our respect for that.

Cor

PS. And we help him of course in the good direction.
:)))
 
M

Michael \(michka\) Kaplan [MS]

See

http://trigeminal.com/codes.asp?ItemID=6

for a working example. How this person expects to use EbExecuteLine in
VB.Net is beyond me -- reflection is the way to go for this kind of
thing....


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
 
H

Herfried K. Wagner [MVP]

Hello,

Michael (michka) Kaplan said:
http://trigeminal.com/codes.asp?ItemID=6

for a working example. How this person expects to use
EbExecuteLine in VB.Net is beyond me -- reflection
is the way to go for this kind of thing....

When compiling the code using VB6 and calling the function, it causes a
_crash_ in the compiled application. It works fine in the IDE.
 
M

Michael \(michka\) Kaplan [MS]

Did you read the explanation of wher the code is intended? It is intended
for VB ADD-INS, where vba6.dll is in use. That DLL is not in use in the
runtime for compiled apps, thus you crash since you were trying to use it
incorrectly.....


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
 
M

Michael \(michka\) Kaplan [MS]

I assume they are just looking for the functionality.... thus reflection.
:)


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top