mcs26
asked on
Creating a DLL in CSharp in .Net
Hi,
I am trying to learn about create DLL's in CSharp. I came across the following website page http://www.geeksengine.com/article/create-dll.html and was trying to replicate the example. I have named my project "LibTest".
In my folder C:\Users\user\Documents\Vi sual Studio 2008\Projects\Mine\LibTest \LibTest\b in\Debug I have three files, LibTest.dll, LibTest.pdb &LibTest.tlb.
I made the LitTest.tlb file by using the following command prompts which I used from a previous question on here.
k ""C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat""
regasm /tlb:LibTest.tlb "C:\Users\user\Documents\V isual Studio 2008\Projects\Mine\LibTest \LibTest\b in\Debug\L ibTest.dll "
When I go to Excel I can add the refernce by selecting the LibTest.tlb file. In the VBA editor when I define a variable objLib the intelliSense suggests the LibTest.Calc as a class. However my problem is when i use the line (shown below) objLib.SetNumberOne the intellisense doesn't pop up with any suggestions & nothing happens.
I read that I needed to use "codebase" with RegAsm. I tried this but could not do it. Please see the error message in the attached word document.
If you could also please explain in english what I'm actually doing that would be brillant.
Thanks,
Mark
LibTest.doc
I am trying to learn about create DLL's in CSharp. I came across the following website page http://www.geeksengine.com/article/create-dll.html and was trying to replicate the example. I have named my project "LibTest".
In my folder C:\Users\user\Documents\Vi
I made the LitTest.tlb file by using the following command prompts which I used from a previous question on here.
k ""C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat""
regasm /tlb:LibTest.tlb "C:\Users\user\Documents\V
When I go to Excel I can add the refernce by selecting the LibTest.tlb file. In the VBA editor when I define a variable objLib the intelliSense suggests the LibTest.Calc as a class. However my problem is when i use the line (shown below) objLib.SetNumberOne the intellisense doesn't pop up with any suggestions & nothing happens.
I read that I needed to use "codebase" with RegAsm. I tried this but could not do it. Please see the error message in the attached word document.
If you could also please explain in english what I'm actually doing that would be brillant.
Thanks,
Mark
Public Function test()
Dim lngResult As Long
Dim objLib As LibTest.Calc
Set objLib = New LibTest.Calc
objLib.SetNumberOne (3)
objLib.SetNumberTwo (6)
lngResult = objLib.Add()
End Function
LibTest.doc
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Again any help would be great.
SimpleCalc-Ex.doc