Click here to Skip to main content
15,900,973 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGrid Cell Color - C# Pin
Not Active3-Sep-04 5:43
mentorNot Active3-Sep-04 5:43 
GeneralRe: DataGrid Cell Color - C# Pin
Jo Develper5-Sep-04 23:16
Jo Develper5-Sep-04 23:16 
Questioncan not return com from c# Pin
umedkurd3-Sep-04 2:11
umedkurd3-Sep-04 2:11 
AnswerRe: can not return com from c# Pin
Heath Stewart3-Sep-04 7:14
protectorHeath Stewart3-Sep-04 7:14 
GeneralRe: can not return com from c# Pin
umedkurd3-Sep-04 7:51
umedkurd3-Sep-04 7:51 
GeneralRe: can not return com from c# Pin
Heath Stewart3-Sep-04 8:15
protectorHeath Stewart3-Sep-04 8:15 
GeneralRe: can not return com from c# Pin
umedkurd3-Sep-04 18:34
umedkurd3-Sep-04 18:34 
GeneralRe: can not return com from c# Pin
Heath Stewart6-Sep-04 9:10
protectorHeath Stewart6-Sep-04 9:10 
Without seeing all the source code, all I can do is make educates "stabs in the dark", but hopefully we can resolve this. Usually the questions are a little more simple. Smile | :)

Are these interfaces declared in unmanaged code (i.e., in an IDL file and registered in HKCR\Interfaces)? If so, don't forget to attribute the re-declaration in managed code with ComImport. This ensures that the CLR performs a QueryInterface for the requested interface instead of just a cast.

If these interfaces are declared in managed code, IIRC they will not be registered in HKCR\Interfaces by regasm.exe. The easiest way to find out is to run regasm.exe /regfile:temp.reg Assembly.dll (replacing "Assembly.dll" with your assembly, of course). You could also generate a typelib and use oleview.exe Assembly.tlb for an IDL-like output, if you like.

If not registered, you can add a couple static parameterless methods and attribute them with the ComRegisterFunctionAttribute and ComUnregisterFunctionAttribute. Keep in mind that these methods are called by regasm.exe in addition to registering your types normally. No need to do the same thing twice.

Also be sure that if you don't install your assembly into the GAC, you use the /codebase option with regasm.exe to register the fully-qualified path to your assembly so that mscoree.dll knows where to find it. Since you can create instances of your COM servers, this doesn't sound like a problem.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles]
GeneralRe: can not return com from c# Pin
umedkurd7-Sep-04 18:42
umedkurd7-Sep-04 18:42 
GeneralMultiple Document Intrface problem-Ineed help Pin
gijoebijoe3-Sep-04 2:05
gijoebijoe3-Sep-04 2:05 
GeneralRe: Multiple Document Intrface problem-Ineed help Pin
sreejith ss nair3-Sep-04 2:52
sreejith ss nair3-Sep-04 2:52 
GeneralExocortex.DSP question Pin
Shiro19813-Sep-04 1:56
Shiro19813-Sep-04 1:56 
QuestionIt allways prints to my default printer but i want to choose the printer in code? Pin
robmays3-Sep-04 1:55
robmays3-Sep-04 1:55 
GeneralCreating a XSLT File Pin
teo_x3-Sep-04 1:53
teo_x3-Sep-04 1:53 
GeneralRe: Creating a XSLT File Pin
sreejith ss nair3-Sep-04 2:55
sreejith ss nair3-Sep-04 2:55 
QuestionHow to invert pixel color of a bitmap ? Pin
sachinkalse3-Sep-04 0:24
sachinkalse3-Sep-04 0:24 
AnswerRe: How to invert pixel color of a bitmap ? Pin
sreejith ss nair3-Sep-04 2:44
sreejith ss nair3-Sep-04 2:44 
GeneralRe: How to invert pixel color of a bitmap ? Pin
sachinkalse5-Sep-04 22:17
sachinkalse5-Sep-04 22:17 
GeneralPluggin' in the Plug-In - HMOG Pin
Sebastian Schneider3-Sep-04 0:20
Sebastian Schneider3-Sep-04 0:20 
GeneralCant change the Expandable property from property grid Pin
pradeep_pc3-Sep-04 0:15
pradeep_pc3-Sep-04 0:15 
GeneralRe: Cant change the Expandable property from property grid Pin
sreejith ss nair3-Sep-04 2:40
sreejith ss nair3-Sep-04 2:40 
GeneralDisable write in comboBox C# Pin
adnanh752-Sep-04 22:35
adnanh752-Sep-04 22:35 
GeneralRe: Disable write in comboBox C# Pin
Syed Abdul Khader2-Sep-04 23:48
Syed Abdul Khader2-Sep-04 23:48 
GeneralRe: Disable write in comboBox C# Pin
shaunAustin2-Sep-04 23:48
shaunAustin2-Sep-04 23:48 
GeneralThanks Pin
adnanh752-Sep-04 23:50
adnanh752-Sep-04 23:50 

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.