Click here to Skip to main content
15,921,028 members
Home / Discussions / COM
   

COM

 
AnswerRe: What is IDispatch Pin
Brian C Hart30-Dec-05 23:34
professionalBrian C Hart30-Dec-05 23:34 
QuestionWhat is CoCreateInstance Pin
Santosh Kumar7913-Oct-05 18:52
Santosh Kumar7913-Oct-05 18:52 
AnswerRe: What is CoCreateInstance Pin
ThatsAlok13-Oct-05 19:53
ThatsAlok13-Oct-05 19:53 
AnswerRe: What is CoCreateInstance Pin
Brian C Hart30-Dec-05 23:30
professionalBrian C Hart30-Dec-05 23:30 
QuestionDebugging COM DLL Pin
Babto13-Oct-05 11:54
Babto13-Oct-05 11:54 
AnswerRe: Debugging COM DLL Pin
Kurt _B18-Oct-05 9:59
Kurt _B18-Oct-05 9:59 
QuestionError in ReleaseUMinSize build only Pin
itkid13-Oct-05 11:06
itkid13-Oct-05 11:06 
QuestionThe problem about Excel automation add-ins. Pin
dreamwinter12-Oct-05 20:49
dreamwinter12-Oct-05 20:49 
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.
Question0x800401fb Pin
Joseph Hayes12-Oct-05 20:39
Joseph Hayes12-Oct-05 20:39 
AnswerRe: 0x800401fb Pin
Roger Stoltz12-Oct-05 20:59
Roger Stoltz12-Oct-05 20:59 
AnswerRe: 0x800401fb Pin
JonEngle26-Oct-05 18:39
JonEngle26-Oct-05 18:39 
QuestionIClassFactory::CreateInstance() Pin
odiesback12-Oct-05 6:50
odiesback12-Oct-05 6:50 
AnswerRe: IClassFactory::CreateInstance() Pin
User 21559712-Oct-05 11:57
User 21559712-Oct-05 11:57 
AnswerRe: IClassFactory::CreateInstance() Pin
rwestgraham12-Oct-05 12:38
rwestgraham12-Oct-05 12:38 
GeneralRe: IClassFactory::CreateInstance() Pin
odiesback13-Oct-05 4:32
odiesback13-Oct-05 4:32 
AnswerRe: IClassFactory::CreateInstance() Pin
odiesback24-Oct-05 5:04
odiesback24-Oct-05 5:04 
QuestionActive Activex in the IDE Pin
lgaudouen11-Oct-05 7:21
lgaudouen11-Oct-05 7:21 
AnswerRe: Active Activex in the IDE Pin
vishalmore13-Oct-05 22:34
vishalmore13-Oct-05 22:34 
QuestionCreating only one instance Pin
ChemmieBro11-Oct-05 5:14
ChemmieBro11-Oct-05 5:14 
QuestionCreate a simple COM application Pin
Member 98603511-Oct-05 0:46
Member 98603511-Oct-05 0:46 
AnswerRe: Create a simple COM application Pin
dreamwinter19-Oct-05 22:26
dreamwinter19-Oct-05 22:26 
QuestionRetrive COM Interfaces Pin
benjamin2310-Oct-05 16:35
benjamin2310-Oct-05 16:35 
AnswerRe: Retrive COM Interfaces Pin
vishalmore11-Oct-05 1:54
vishalmore11-Oct-05 1:54 
AnswerRe: Retrive COM Interfaces Pin
User 21559711-Oct-05 8:37
User 21559711-Oct-05 8:37 
GeneralRe: Retrive COM Interfaces Pin
benjamin2311-Oct-05 16:53
benjamin2311-Oct-05 16:53 

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.