Thread View: borland.public.csharpbuilder.language.csharp
3 messages
3 total messages
Started by Looki VanDyke
Tue, 17 Apr 2007 07:06
CSharp / OLE
Author: Looki VanDyke
Date: Tue, 17 Apr 2007 07:06
Date: Tue, 17 Apr 2007 07:06
52 lines
1516 bytes
1516 bytes
Hi,
I want to get a
string value out of
an
activex-component.
I solved it easily
in delphi:
var
hlpstrptr
: WideString;
hlp_string
: String;
...
ActiveXComponent.GetCreatorID(hlpstrptr);
hlp_CreatorID :=
hlpstrptr;
but in C# ??
I only know that
string hlpstr =
"";
result =
axActiveXComponent1.GetCreatorID(ref
hlpstr);
will not work, cause
the
"ActiveXComponent.GetCreatorID"-function
fails
with "wrong
parameter type".
So: hlpstr should be
a pointer to a
WideString (in
"dephi-words")
How can I achive
this with C#?
Best regards
Loki
Re: CSharp / OLE
Author: Marc Rohloff TeamB
Date: Thu, 19 Apr 2007 03:16
Date: Thu, 19 Apr 2007 03:16
28 lines
1802 bytes
1802 bytes
On Tue, 17 Apr 2007 09:06:16 +0200, Looki VanDyke wrote: > I only know that > string hlpstr = ""; > > result = > axActiveXComponent1.GetCreatorID(ref > hlpstr); > > will not work, cause the > "ActiveXComponent.GetCreatorID"-function > fails with "wrong parameter type". > > So: hlpstr should be a pointer to a WideString (in > "dephi-words") > How can I achive this with C#? .NET doesn't have the concept of a pointer to a widestring. The first thing to do would be to find out what the GetCreatorID function expects as parameters, code insite should tell you this as should a decent reflection tool. What ActiveX are you trying to access? -- Marc Rohloff [TeamB] marc -at- marc rohloff -dot- com
Re: CSharp / OLE
Author: Looki VanDyke
Date: Fri, 20 Apr 2007 07:33
Date: Fri, 20 Apr 2007 07:33
58 lines
2273 bytes
2273 bytes
Marc Rohloff [TeamB] schrieb: > On Tue, 17 Apr 2007 09:06:16 +0200, Looki VanDyke wrote: > >> I only know that >> string hlpstr = ""; >> >> result = >> axActiveXComponent1.GetCreatorID(ref >> hlpstr); >> >> will not work, cause the >> "ActiveXComponent.GetCreatorID"-function >> fails with "wrong parameter type". >> >> So: hlpstr should be a pointer to a WideString (in >> "dephi-words") >> How can I achive this with C#? > > .NET doesn't have the concept of a pointer to a widestring. > > The first thing to do would be to find out what the GetCreatorID > function expects as parameters, code insite should tell you this as > should a decent reflection tool. > The documentation of this routine says: long GetCreatorID(BSTR FAR* pbstrCreatorID); The result of this function is -4, a table in the documentation says that -4 is "invalid parameter" (buy the way you are right this error message is internally created by the activex component). Never the less I got the same result when I tried hlpstr : String instead of hlpstr : WideString with delphi. Therefor I need an equivalent expression for this in C#. Thanks in advance Loki.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads