473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to obtain a pointer of string variable

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
Nov 20 '05 #1
30 6430
Armin,

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

Please mark these irrelevancies as OT? ;-)

Regards,
Fergus
Nov 20 '05 #2
Hello,

"Ashok" <as**********@yahoo.com> schrieb:
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?!

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3
Cor
Hi Fergus,
Up again, was not so late last night I saw as usual (In this newsgroup)..
Oeps I almost forgot OT
Cor
Nov 20 '05 #4
"Ashok" <as**********@yahoo.com> schrieb
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.
--
Armin

Nov 20 '05 #5
Armin,

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

Please mark these irrelevancies as OT? ;-)

Regards,
Fergus
Nov 20 '05 #6
"Fergus Cooney" <fi******@tesco.net> schrieb
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. ;-)
--
Armin

Nov 20 '05 #7
Cor
Hi Fergus,
Up again, was not so late last night I saw as usual (In this newsgroup)..
Oeps I almost forgot OT
Cor
Nov 20 '05 #8
Hello,

"Cor" <no*@non.com> schrieb:
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?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #9
Hello,

"Armin Zingler" <az*******@freenet.de> schrieb:
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.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #10
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
Nov 20 '05 #11
"Fergus Cooney" <fi******@tesco.net> schrieb
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. ;-)
--
Armin

Nov 20 '05 #12
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


Nov 20 '05 #13
Hello,

"Cor" <no*@non.com> schrieb:
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

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #14
Hello,

"Cor" <no*@non.com> schrieb:
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?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #15
Hello,

"Armin Zingler" <az*******@freenet.de> schrieb:
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.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #16
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
Nov 20 '05 #17
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
Nov 20 '05 #18
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


Nov 20 '05 #19
Hello,

"Cor" <no*@non.com> schrieb:
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

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #20
"Fergus Cooney" <fi******@tesco.net> schrieb

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. :-)
--
Armin

Nov 20 '05 #21
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
Nov 20 '05 #22
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.
:-)))
Nov 20 '05 #23
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.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:ez*************@tk2msftngp13.phx.gbl...
Hello,

"Armin Zingler" <az*******@freenet.de> schrieb:
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.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #24
Hello,

"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> schrieb:
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.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #25
"Fergus Cooney" <fi******@tesco.net> schrieb

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. :-)
--
Armin

Nov 20 '05 #26
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.
:-)))
Nov 20 '05 #27
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.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:ez*************@tk2msftngp13.phx.gbl...
Hello,

"Armin Zingler" <az*******@freenet.de> schrieb:
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.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #28
Hello,

"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> schrieb:
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.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #29
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.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
Hello,

"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> schrieb:
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.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #30
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.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello,

"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> schrieb:
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.....


I know, that's why I asked why the OP wanted to use the function in a .NET
application.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #31

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Chris Mantoulidis | last post by:
I see some really weird output from this program (compiled with GCC 3.3.2 under Linux). #include <iostream> using namespace std; int main() { char *s; s = "test1"; cout << "s = " << s << "...
4
by: Markus Dehmann | last post by:
I guess this is a kind of newbie question (since most pointer questions are newbie questions). In the program below, modify(string* s) is supposed to change the content that s points to. But the...
4
by: archmonkey | last post by:
Hello Is there a way to get a pointer to a variable through the variable name represented as a string? Let me explain it through an example: /* Start code example */ int MyVar = 3;
4
by: Paul | last post by:
hi, there, In the following codes, If I change the varible "string "in main() to char* string=" this is the test string "; the program will be crashed. can someone tell me why and how...
2
by: Ashok | last post by:
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...
16
by: Dave | last post by:
I'm having a problem trying to set up code in VB to handle the case where an argument in an API definition is defined as a pointer to a pointer. An excerpt from the API's definition is: void...
15
by: ajj | last post by:
Hello All, Yes this is homework, but I have spent a lot of time on it and I am close. I want to be able to count the number of nodes in a tree that have only one child. I can identify the...
9
by: Cyron | last post by:
Hello friends, Recently I have begun exploring the features that the STL map collection provides. While learning how it worked, I encountered a result that confused me. Up until now, I had...
19
by: mail1779205 | last post by:
I (certainly) hope I know what this function does: char *fun(void){ char *ptr = "Hello World"; return ptr; } It returns a pointer to a string stored somewhere in the memory and is...
11
by: Jacek Dziedzic | last post by:
Hi! I need a routine like: std::string nth_word(const std::string &s, unsigned int n) { // return n-th word from the string, n is 0-based // if 's' contains too few words, return "" //...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.