Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: Persist ListViewItem backColor when using HideSelection= false Pin
mhmoud rawas23-Nov-04 1:37
mhmoud rawas23-Nov-04 1:37 
GeneralCalling C# functions from a DLL from within unmanaged C++ Pin
Uwe Keim22-Nov-04 22:18
sitebuilderUwe Keim22-Nov-04 22:18 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
mhmoud rawas23-Nov-04 1:47
mhmoud rawas23-Nov-04 1:47 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Mike Dimmick23-Nov-04 2:20
Mike Dimmick23-Nov-04 2:20 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Uwe Keim23-Nov-04 19:29
sitebuilderUwe Keim23-Nov-04 19:29 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Nick Parker23-Nov-04 4:57
protectorNick Parker23-Nov-04 4:57 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Uwe Keim23-Nov-04 5:02
sitebuilderUwe Keim23-Nov-04 5:02 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Heath Stewart23-Nov-04 5:58
protectorHeath Stewart23-Nov-04 5:58 
Both Mike's and Nick's answers are correct, but I wanted to explain what #import - the way you're using it - is. It serves two purposes - including assembly references in Managed C++ and importing typelibs, which generates a header and allows you to specify options for how that header file is generated.

Even if you have a typelib a la regasm.exe /tlb MyAssembly.dll and import that (as I did in my Java/.NET interop article), the classes still need to be registered. A typelib - as I'm sure you know - only describes types, nothing more.

If you go with Mike's approach about using manifests and don't want to register the components to be used by other COM clients (although, since that is the easiest, ask yourself "why not?". there's lots of "private" COM components registered on your system), understand that it'll only work on XP and newer and make sure that down-level platforms get a user-friendly error for when that type won't be found (off-hand, I'd bet you'd get either a TypeLoadException or TargetInvocationException).

Hosting the CLR is another good idea and isn't too much work for the basic functionality.

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

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Uwe Keim23-Nov-04 6:11
sitebuilderUwe Keim23-Nov-04 6:11 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Nick Parker23-Nov-04 7:22
protectorNick Parker23-Nov-04 7:22 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Uwe Keim23-Nov-04 7:34
sitebuilderUwe Keim23-Nov-04 7:34 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Nick Parker23-Nov-04 8:02
protectorNick Parker23-Nov-04 8:02 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Heath Stewart23-Nov-04 8:40
protectorHeath Stewart23-Nov-04 8:40 
GeneralDrawing & Scaling Pin
Prof AKA22-Nov-04 21:37
Prof AKA22-Nov-04 21:37 
GeneralRe: Drawing & Scaling Pin
Gary Thom23-Nov-04 3:17
Gary Thom23-Nov-04 3:17 
GeneralGet the command line parameters of an external process. Pin
Matt Philmon22-Nov-04 19:42
Matt Philmon22-Nov-04 19:42 
GeneralRe: Get the command line parameters of an external process. Pin
Guinness4Strength9-Sep-06 6:53
Guinness4Strength9-Sep-06 6:53 
GeneralRe: Get the command line parameters of an external process. Pin
Matt Philmon9-Sep-06 9:51
Matt Philmon9-Sep-06 9:51 
QuestionDatagrid? Pin
murali_utr22-Nov-04 19:08
murali_utr22-Nov-04 19:08 
AnswerRe: Datagrid? Pin
sreejith ss nair22-Nov-04 19:20
sreejith ss nair22-Nov-04 19:20 
AnswerRe: Datagrid? Pin
Gary Thom23-Nov-04 3:20
Gary Thom23-Nov-04 3:20 
QuestionObject Writer? Pin
Rafferty Uy22-Nov-04 18:37
Rafferty Uy22-Nov-04 18:37 
AnswerRe: Object Writer? Pin
Daniel Turini22-Nov-04 19:14
Daniel Turini22-Nov-04 19:14 
GeneralHandle MS IIS Pin
pmasknguyen22-Nov-04 16:00
pmasknguyen22-Nov-04 16:00 
GeneralRe: Handle MS IIS Pin
Gerald Schwab22-Nov-04 16:27
Gerald Schwab22-Nov-04 16:27 

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.