Hi,
Is there a way to use vb6 components in C#, just like in old asp (Server.CreateObject)...
I tried with Activator.CreateInstance but didn't worked...is continue to as kfor the reference...
Hi,
Is there a way to use vb6 components in C#, just like in old asp (Server.CreateObject)...
I tried with Activator.CreateInstance but didn't worked...is continue to as kfor the reference...
using vb6 component ?
Lintubird
Tamiri
c is null....how can I use POC
I'm calling the method just like in vb6 the function inside de dll, with the 2 parameters !
Oz22
OK, Now it worked..
Type objAddType = Type.GetTypeFromProgID("ACEGAC.clsAdmDBConsultas");
//Create Instance object objConsultas = Activator.CreateInstance(objAddType); //Make Array of Arguments object[] myArguments = { 1 }; object c;c = objAddType.InvokeMember("ConsultarAgendamento", BindingFlags.InvokeMethod,
null, objConsultas, myArguments);MessageBox.Show(c.ToString());
But there is still a problem, how can I make to show the values of the c object...
Like in VB6 it returns a recordset....
Thanks for helping again.
moniker
Robert3234
Those articles are not helping you
What is hapening if you create reference of ADODB and typecast your object"c" to that
FC-Shiro
ne_plus_ultra
Hey, I am back again!!!
Have a look at following article
http://www.codeproject.com/csharp/usecomappincs.asp
The late binding section should help.
Excerpt for the article
IDispatchInterface usingType.GetTypeFromProgID("Project1.Class1")Activator.CreateInstance(objAddType)objAddType.InvokeMemberfunction.PsychUK
I am at work and not having MSN (good that I have access to msdn
). And I do not have VB6 too... so I am not able to create dll :-( ......
Are you able to return simple value (not the record set) from the dll in c#
satish_k
Good Morning!!
Have you able to get the desired results According to you what could be the reason of the exception. You said, it is not about casting, right. Have you able to figureout something.
Eitan Shapir
Fom dll, in vb6 yes, from the C# directly yes...... But from the DLL in vb6 through C# I can't....and for security reasons in the client side I can't connect directly to the database...Damm it...=)
MarcNelson
OK,
It gives me this exception "An exception was added by the destiny of a call", lol....I think I'm gonna give up...
Too difficult to do that
sideswipe
Hughsieman
This is the way I'm using to test... I created my own...And I'm trying to get the result as the original one might do....
Do you have MSN I can send you the files if you want to try...
Or if you can...make a test there.... Create a dll in vb6 to select a value from SQL Server...and return it as string.....test in another vb project...IF it's working try to use the code I post to get it's value...
Atul Bahl
I think for that you need to typecast/convert object "c" to appropriate type. In your case it is recordset which is getting return.
Hope following article helps you
http://support.microsoft.com/kb/308611
and
http://support.microsoft.com/kb/313330