forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
-
Robert Wullenk
Post
by Robert Wullenk » 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...
-
Krzysztof Dorko
Post
by Krzysztof Dorko » 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
You do not have the required permissions to view the files attached to this post.
-
Krzysztof Dorko
Post
by Krzysztof Dorko » 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
-
Robert Wullenk
Post
by Robert Wullenk » 28 Jan 2009, 16:00
Posted by: Robert Wullenk
Okay,
thank you for the answer, the white paper was very helpful. 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...
-
Krzysztof Dorko
Post
by Krzysztof Dorko » 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
-
Robert Wullenk
Post
by Robert Wullenk » 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
-
Krzysztof Dorko
Post
by Krzysztof Dorko » 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
-
Robert Wullenk
Post
by Robert Wullenk » 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
You do not have the required permissions to view the files attached to this post.
-
Krzysztof Dorko
Post
by Krzysztof Dorko » 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
-
Robert Wullenk
Post
by Robert Wullenk » 30 Jan 2009, 08:48
Posted by: Robert Wullenk
ohhh,...
it works!
thank you for the answer.
so long...
robert
-
aleksei mendez
Post
by aleksei mendez » 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
-
Robert Wullenk
Post
by Robert Wullenk » 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
-
Jim McNamara
Post
by Jim McNamara » 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)
-
Robert Wullenk
Post
by Robert Wullenk » 12 May 2009, 11:37
Posted by: Robert Wullenk
hello jim,
sorry, but the problem is still exists.
-
Jim McNamara
Post
by Jim McNamara » 12 May 2009, 15:42
Posted by: Jim McNamara
I don't see the AssemblyInfo.cs file in your project. It should contain
this line:
[assembly: ComVisible(true)]
Also in the project properties, on the Build tab, make sure Register for COM
interop is checked.
Who is online
Users browsing this forum: [Ccbot] and 0 guests