use c# dll file in team developer 2005.0

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 26 Jan 2009, 07:59

 Posted by:  Robert Wullenk 

Hello,

i'm a beginner in programming in Team Developer. I want to import an c#
dll-File. The File has a function with an return value.
I don't know why I do that. How can I import the file and use the
function???
I programming with team developer 2005.0.
Please help me!
Thanks....

so long...

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 26 Jan 2009, 15:15

 Posted by:  Krzysztof Dorko 

Hi
Unfortunately you cannot deal with C# so much. The only one way to do this
is when your c# lib is COM accessible. If so, this white paper can help if
not you should modify c# lib.
hth
Kris

Attachment: TDNet.pdf

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 26 Jan 2009, 15:20

 Posted by:  Krzysztof Dorko 

I am sorry.
Of course you can create a web service in C# and then access your functions
from Team Developer.
hth
Kris

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 28 Jan 2009, 16:00

 Posted by:  Robert Wullenk 

Okay,
thank you for the answer, the white paper was very helpfull. I build the dll
file like the sample in the white paper. Then i want to load the dll file in
the Active X Explorer. But I get an error message. Unaable to load type
library "C:\*******\test.dll".
Where is the mistake?
Sorry, but my english is not so good.
so long...

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 28 Jan 2009, 17:04

 Posted by:  Krzysztof Dorko 

Do you have this type library in this folder?
Do you have VS project on the same machine with GTD?
Did you try register this assembly with regasm.exe? (If prev answer is 'NO')
(And you should remember to do this when you will deploy your app)

Kris

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 29 Jan 2009, 11:02

 Posted by:  Robert Wullenk 

hi,
okay,... at first I develop in VS.NET and Team Developer on the same
machine.
I created a type library file with tlbexp.exe.
Then I loaded the dll-File in Team Developer.
But now when I call the function from the dll File i don't get a return
value.
In the c# function i write 'return "Hello";'.
I call the function like the description in the white paper.
What's wrong.
Do you have any other sample code for me. I don't see the mistake.

so long...
robert

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 29 Jan 2009, 15:29

 Posted by:  Krzysztof Dorko 

Hi
Since you have not attached you c# project I can't see any mistake either.
I can only guess than your c# project is not configured to create com
objects (Are you using express edition?)
Or you have made mistake doing translation from vb to c#.
It could be a way you handle interfaces.
It should be done like this.
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
public interface IMyInterface
hth
Kris

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 29 Jan 2009, 15:57

 Posted by:  Robert Wullenk 

hi,

i work with express. i think the sourcecode is right.
her is my project, the archiv include the apt and the vs c# project.
thanks

Attachment: .NETClient.zip

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 29 Jan 2009, 16:36

 Posted by:  Krzysztof Dorko 

Ok
So
C# is "ok" but you forgot declare namespace and in gupta you are trying to
create object "ManageClass.NETClass"
Where "ManageClass" is really namespace name in c#, So you have two options
here 1. Add namespace to your c# project what is in my opinion the best
solution; or 2. Remove this namespace and leave only "NETClass" in you Gupta
code.
The second solution works fine but is good only for tests and small
projects.
hth
Kris

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 30 Jan 2009, 08:48

 Posted by:  Robert Wullenk 

ohhh,...
it works!
thank you for the answer.

so long...
robert

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 02 Apr 2009, 00:04

 Posted by:  aleksei mendez 

please,
do you want to sendme library
it's works with dll of vb too?

an last :D do you can convert to tue 1.5.1 version
tnx

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 02 Apr 2009, 00:28

 Posted by:  aleksei mendez 

wath can I do for invoke of dll witout add like active x?
also like
Set nVar = Invoke(''library.dll","TheFunction", "thePArameter")

i do this in vb2008 it's for dynamic calls

For Each methodsAssembly In methods

If strMetodos = methodsAssembly.Name Then

Select Case methodsAssembly.Name

Case "OnSave" : strMessage =
methodsAssembly.Invoke(obj, New [Object]() {InstanceName, dsData, strKeys})

Case "OnDelete" : strMessage =
methodsAssembly.Invoke(obj, New [Object]() {InstanceName, strKeys})

Case "OnFind" : strMessage =
methodsAssembly.Invoke(obj, New [Object]() {InstanceName, dsStruct, strKeys,
dsData})

End Select

End If

Next methodsAssembly

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 30 Apr 2009, 12:15

 Posted by:  Robert Wullenk 

hello,
i have the next problem :) !
the app is complete, but when I install the app on an other computer the
myInterface.CreateObject("Namespace.Class") function get boolean "FALSE"!
what's wrong?
the computer has framework 3.0. on my computer is framework 3.0, too!
when i start the app on my computer the
myInterface.CreateObject("Namespace.Class") function get "TRUE"!
the new app is an update with a new c# dll. the dll i need for a new
feature!
the app was ok before i install the update.

please help me!

thanks
robert

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 30 Apr 2009, 14:01

 Posted by:  Jim McNamara 

Did the GUID of the assembly change?

Maybe it needs to be re-registered (see regasm.exe)

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

use c# dll file in team developer 2005.0

Post by NewsgroupServer » 12 May 2009, 11:37

 Posted by:  Robert Wullenk 

hello jim,

sorry, but the problem is still exists.

Return to “td.sourcecode”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests