Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
Questionmobile agent implementation Pin
sujeer00912-Oct-05 23:23
sujeer00912-Oct-05 23:23 
QuestionNested Datagrids Pin
Member 124072312-Oct-05 22:46
Member 124072312-Oct-05 22:46 
QuestionLoad Balanced Network Pin
Andre Trollip12-Oct-05 21:26
Andre Trollip12-Oct-05 21:26 
AnswerRe: Load Balanced Network Pin
XRaheemX13-Oct-05 3:54
XRaheemX13-Oct-05 3:54 
AnswerRe: Load Balanced Network Pin
Dave Kreskowiak13-Oct-05 6:25
mveDave Kreskowiak13-Oct-05 6:25 
QuestionTreeView selectedNode problem Pin
ppp00112-Oct-05 21:07
ppp00112-Oct-05 21:07 
AnswerRe: TreeView selectedNode problem Pin
mav.northwind12-Oct-05 23:21
mav.northwind12-Oct-05 23:21 
QuestionThe problem about Excel Automation add-ins(C#) Pin
dreamwinter12-Oct-05 20:48
dreamwinter12-Oct-05 20:48 
D'Oh! | :doh: Excel enables the creation of user-defined functions that can be used in Excel formulas. So I use these code to create a COM introp.
-------------------------------------------------
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32;

namespace AutomationAddin {
[ClassInterface(ClassInterfaceType.AutoDual)]
public class MyFunctions {
public MyFunctions() {
}

public double MultiplyNTimes(double number1,
double number2, double timesToMultiply) {
double result = number1;
for (double i = 0; i < timesToMultiply; i++) {
result = result * number2;
}
return result;
}

[ComRegisterFunctionAttribute]
public static void RegisterFunction(Type type) {
Registry.ClassesRoot.CreateSubKey(
GetSubKeyName(type));
}

[ComUnregisterFunctionAttribute]
public static void UnregisterFunction(Type type) {
Registry.ClassesRoot.DeleteSubKey(
GetSubKeyName(type), false);
}

private static string GetSubKeyName(Type type) {
System.Text.StringBuilder s =
new System.Text.StringBuilder();
s.Append(@"CLSID\{");
s.Append(type.GUID.ToString().ToUpper());
s.Append(@"}\Programmable");
return s.ToString();
}
}
}


-----------------------------------------------------
And set project build property,checked output item,register COM interop.
Building the project,that's success.
Launch Excel and choose Add-Ins from the Tools menu to display the Add-Ins dialog. In the Add-Ins dialog, click the Automation button. But I can't find the class I created by looking for AutomationAddin.MyFunctions in the list of automation servers.
What's wrong? Please help me !Thanks,by the way,My development tool is VS2005 ,Office 2003 (sp2)simply chinese.
QuestionDisabling controls Pin
Brendan Vogt12-Oct-05 20:29
Brendan Vogt12-Oct-05 20:29 
AnswerRe: Disabling controls Pin
XRaheemX13-Oct-05 3:43
XRaheemX13-Oct-05 3:43 
AnswerRe: Disabling controls Pin
Dave Kreskowiak13-Oct-05 6:22
mveDave Kreskowiak13-Oct-05 6:22 
Questionalignment problem please help me its urgent Pin
arusmemon12-Oct-05 19:42
arusmemon12-Oct-05 19:42 
QuestionScrolling the RichtextBox Pin
AB777112-Oct-05 19:21
AB777112-Oct-05 19:21 
AnswerRe: Scrolling the RichtextBox Pin
mav.northwind12-Oct-05 20:15
mav.northwind12-Oct-05 20:15 
QuestionSend Pack Data from Server To Client In C# ? Pin
thk2612-Oct-05 18:40
thk2612-Oct-05 18:40 
AnswerRe: Send Pack Data from Server To Client In C# ? Pin
David Stone12-Oct-05 19:40
sitebuilderDavid Stone12-Oct-05 19:40 
QuestionNeed control structure to validate Text Input Pin
...---...12-Oct-05 16:31
...---...12-Oct-05 16:31 
QuestionWork with scenario in c#? Pin
mpw_12-Oct-05 16:10
mpw_12-Oct-05 16:10 
QuestionHow to quickly draw a transparent image Pin
cchere12-Oct-05 14:57
cchere12-Oct-05 14:57 
AnswerRe: How to quickly draw a transparent image Pin
sduhd12-Oct-05 15:38
sduhd12-Oct-05 15:38 
GeneralRe: How to quickly draw a transparent image Pin
Anonymous12-Oct-05 15:43
Anonymous12-Oct-05 15:43 
QuestionHow to Draw a Rectangle? Pin
sduhd12-Oct-05 14:53
sduhd12-Oct-05 14:53 
AnswerRe: How to Draw a Rectangle? Pin
Gulfraz Khan13-Oct-05 2:18
Gulfraz Khan13-Oct-05 2:18 
QuestionSystem.Appdomain.CreateDomain(...) returns __TransparentProxy Pin
Rein_Petersen12-Oct-05 9:28
Rein_Petersen12-Oct-05 9:28 
AnswerRe: System.Appdomain.CreateDomain(...) returns __TransparentProxy Pin
leppie12-Oct-05 11:19
leppie12-Oct-05 11:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.