468,531 Members | 1,605 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,531 developers. It's quick & easy.

please help exporting function!

gs
I have searched Google, MSDN,... for a week. I am still unable to make
available functions in my csharp dll as native windows functions for some
legacy non dotnet application
I just want to expose the regex function to my old legacy application built
with some tools that runs a VM with capability to access windows native DLL
via declaration syntax like
public int function setRegexp(String argRegexp) alias
"ClassIeString.setRegexp"
That Vm also can access OLE automation just like vbscript or vba

In other word the VM can access any dll public functions built for windows
native non dotnet app.

I must be getting old and senile or just too dense. for anything but simple
tools. otherwise I just did not have the right search term to get succinctly
the step I need to get working. I have seen one example that did not work
and could not recompiled either

I have in my csharp code something like these

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
public class ClassIeString
{
Regex myregexp;

public int setRegexp(String argRegexp)
{
...the code....
}

public int getMatches(String myString2Match, String[] strResult,
long[] matchposn)
{
... some code...
}
}

the project properties were:
assembly name ClassIeString
deflt namespace ClassIeString
Output type Class Library
enable XP-visual styles

I also tried without and without com visible attribute

I understand what I got built was managed code so I need to wrap the
resulting dll from above built via visual studio c# 2005 beta 2..

Actually I don't care if have to use C++ to get the job done although I
would be absolutely green and ignorant there.

I would very much appreciate if someone give me some foolproof steps to make
available some regex function to the legacy application.
Please bear with me that I am not a dot net developer nor much of c, C++
coder either.
Nov 17 '05 #1
4 1430
gs,

On it's own, you can not export functions from managed DLLs. You can
register your .NET types as COM types, so you should do that (considering
that you can use automation components).

Check out the section of the MSDN documentation titled "Exposing .NET
Framework Components to COM", located at (watch for line wrap):

http://msdn.microsoft.com/library/de...nentstocom.asp

It should give you the information you need to expose your types to COM.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gs" <gs@nomail.nil> wrote in message
news:uW****************@tk2msftngp13.phx.gbl...
I have searched Google, MSDN,... for a week. I am still unable to make
available functions in my csharp dll as native windows functions for some
legacy non dotnet application
I just want to expose the regex function to my old legacy application
built with some tools that runs a VM with capability to access windows
native DLL via declaration syntax like
public int function setRegexp(String argRegexp) alias
"ClassIeString.setRegexp"
That Vm also can access OLE automation just like vbscript or vba

In other word the VM can access any dll public functions built for windows
native non dotnet app.

I must be getting old and senile or just too dense. for anything but
simple tools. otherwise I just did not have the right search term to get
succinctly the step I need to get working. I have seen one example that
did not work and could not recompiled either

I have in my csharp code something like these

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
public class ClassIeString
{
Regex myregexp;

public int setRegexp(String argRegexp)
{
...the code....
}

public int getMatches(String myString2Match, String[] strResult,
long[] matchposn)
{
... some code...
}
}

the project properties were:
assembly name ClassIeString
deflt namespace ClassIeString
Output type Class Library
enable XP-visual styles

I also tried without and without com visible attribute

I understand what I got built was managed code so I need to wrap the
resulting dll from above built via visual studio c# 2005 beta 2..

Actually I don't care if have to use C++ to get the job done although I
would be absolutely green and ignorant there.

I would very much appreciate if someone give me some foolproof steps to
make available some regex function to the legacy application.
Please bear with me that I am not a dot net developer nor much of c, C++
coder either.

Nov 17 '05 #2
gs
thank you, unfortunately, the ViM deals with only OLE and native DLL but not
com components.. If my understanding is correct COM is a different format
from OLE server or automation, right?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:e7****************@TK2MSFTNGP09.phx.gbl...
gs,

On it's own, you can not export functions from managed DLLs. You can
register your .NET types as COM types, so you should do that (considering
that you can use automation components).

Check out the section of the MSDN documentation titled "Exposing .NET
Framework Components to COM", located at (watch for line wrap):

http://msdn.microsoft.com/library/de...nentstocom.asp

It should give you the information you need to expose your types to
COM.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gs" <gs@nomail.nil> wrote in message
news:uW****************@tk2msftngp13.phx.gbl...
I have searched Google, MSDN,... for a week. I am still unable to make
available functions in my csharp dll as native windows functions for some
legacy non dotnet application
I just want to expose the regex function to my old legacy application
built with some tools that runs a VM with capability to access windows
native DLL via declaration syntax like
public int function setRegexp(String argRegexp) alias
"ClassIeString.setRegexp"
That Vm also can access OLE automation just like vbscript or vba

In other word the VM can access any dll public functions built for
windows native non dotnet app.

I must be getting old and senile or just too dense. for anything but
simple tools. otherwise I just did not have the right search term to get
succinctly the step I need to get working. I have seen one example that
did not work and could not recompiled either

I have in my csharp code something like these

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
public class ClassIeString
{
Regex myregexp;

public int setRegexp(String argRegexp)
{
...the code....
}

public int getMatches(String myString2Match, String[] strResult,
long[] matchposn)
{
... some code...
}
}

the project properties were:
assembly name ClassIeString
deflt namespace ClassIeString
Output type Class Library
enable XP-visual styles

I also tried without and without com visible attribute

I understand what I got built was managed code so I need to wrap the
resulting dll from above built via visual studio c# 2005 beta 2..

Actually I don't care if have to use C++ to get the job done although I
would be absolutely green and ignorant there.

I would very much appreciate if someone give me some foolproof steps to
make available some regex function to the legacy application.
Please bear with me that I am not a dot net developer nor much of c, C++
coder either.


Nov 17 '05 #3
gs,

No, OLE evolved into COM. The basics are all the same. That's why
there are still a good number of APIs that are prefixed with "Ole". COM is
the supersystem that encompases Automation. All Automation components are
COM components.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gs" <gs@nomail.nil> wrote in message
news:uL**************@TK2MSFTNGP10.phx.gbl...
thank you, unfortunately, the ViM deals with only OLE and native DLL but
not com components.. If my understanding is correct COM is a different
format from OLE server or automation, right?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:e7****************@TK2MSFTNGP09.phx.gbl...
gs,

On it's own, you can not export functions from managed DLLs. You can
register your .NET types as COM types, so you should do that (considering
that you can use automation components).

Check out the section of the MSDN documentation titled "Exposing .NET
Framework Components to COM", located at (watch for line wrap):

http://msdn.microsoft.com/library/de...nentstocom.asp

It should give you the information you need to expose your types to
COM.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gs" <gs@nomail.nil> wrote in message
news:uW****************@tk2msftngp13.phx.gbl...
I have searched Google, MSDN,... for a week. I am still unable to make
available functions in my csharp dll as native windows functions for some
legacy non dotnet application
I just want to expose the regex function to my old legacy application
built with some tools that runs a VM with capability to access windows
native DLL via declaration syntax like
public int function setRegexp(String argRegexp) alias
"ClassIeString.setRegexp"
That Vm also can access OLE automation just like vbscript or vba

In other word the VM can access any dll public functions built for
windows native non dotnet app.

I must be getting old and senile or just too dense. for anything but
simple tools. otherwise I just did not have the right search term to get
succinctly the step I need to get working. I have seen one example that
did not work and could not recompiled either

I have in my csharp code something like these

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
public class ClassIeString
{
Regex myregexp;

public int setRegexp(String argRegexp)
{
...the code....
}

public int getMatches(String myString2Match, String[] strResult,
long[] matchposn)
{
... some code...
}
}

the project properties were:
assembly name ClassIeString
deflt namespace ClassIeString
Output type Class Library
enable XP-visual styles

I also tried without and without com visible attribute

I understand what I got built was managed code so I need to wrap the
resulting dll from above built via visual studio c# 2005 beta 2..

Actually I don't care if have to use C++ to get the job done although I
would be absolutely green and ignorant there.

I would very much appreciate if someone give me some foolproof steps to
make available some regex function to the legacy application.
Please bear with me that I am not a dot net developer nor much of c,
C++ coder either.



Nov 17 '05 #4
gs

Thank you for explaining.

So COM is superset of OLE automation but is it backward compatible?

What I am asking is if an application understand and can plug into OLE
automation,,\ is it truly capable of a COM component?

If so, I should be able to turn on the com visible attribute and let vstudio
2005 to expose all my public functions and classes to COM and then all I
would have to do for that application using the VM is to access via OLE
automation object. Right?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP15.phx.gbl...
gs,

No, OLE evolved into COM. The basics are all the same. That's why
there are still a good number of APIs that are prefixed with "Ole". COM
is the supersystem that encompases Automation. All Automation components
are COM components.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gs" <gs@nomail.nil> wrote in message
news:uL**************@TK2MSFTNGP10.phx.gbl...
thank you, unfortunately, the ViM deals with only OLE and native DLL but
not com components.. If my understanding is correct COM is a different
format from OLE server or automation, right?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:e7****************@TK2MSFTNGP09.phx.gbl...
gs,

On it's own, you can not export functions from managed DLLs. You can
register your .NET types as COM types, so you should do that
(considering that you can use automation components).

Check out the section of the MSDN documentation titled "Exposing .NET
Framework Components to COM", located at (watch for line wrap):

http://msdn.microsoft.com/library/de...nentstocom.asp

It should give you the information you need to expose your types to
COM.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"gs" <gs@nomail.nil> wrote in message
news:uW****************@tk2msftngp13.phx.gbl...
I have searched Google, MSDN,... for a week. I am still unable to make
available functions in my csharp dll as native windows functions for
some legacy non dotnet application
I just want to expose the regex function to my old legacy application
built with some tools that runs a VM with capability to access windows
native DLL via declaration syntax like
public int function setRegexp(String argRegexp) alias
"ClassIeString.setRegexp"
That Vm also can access OLE automation just like vbscript or vba

In other word the VM can access any dll public functions built for
windows native non dotnet app.

I must be getting old and senile or just too dense. for anything but
simple tools. otherwise I just did not have the right search term to
get succinctly the step I need to get working. I have seen one example
that did not work and could not recompiled either

I have in my csharp code something like these

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
public class ClassIeString
{
Regex myregexp;

public int setRegexp(String argRegexp)
{
...the code....
}

public int getMatches(String myString2Match, String[] strResult,
long[] matchposn)
{
... some code...
}
}

the project properties were:
assembly name ClassIeString
deflt namespace ClassIeString
Output type Class Library
enable XP-visual styles

I also tried without and without com visible attribute

I understand what I got built was managed code so I need to wrap the
resulting dll from above built via visual studio c# 2005 beta 2..

Actually I don't care if have to use C++ to get the job done although I
would be absolutely green and ignorant there.

I would very much appreciate if someone give me some foolproof steps to
make available some regex function to the legacy application.
Please bear with me that I am not a dot net developer nor much of c,
C++ coder either.



Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Bilgehan.Balban | last post: by
2 posts views Thread by Mux | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.