Click here to Skip to main content
15,894,896 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
Generalassign mfc handle to dotnet form Pin
luke0530-Jul-04 1:36
luke0530-Jul-04 1:36 
GeneralUpdating multiple treeviews Pin
Sam Barham29-Jul-04 13:45
Sam Barham29-Jul-04 13:45 
GeneralConverting a managed .NET System::String to an unmanaged, UTF-8 encoded, null-terminated char array Pin
jerrycainjr29-Jul-04 8:30
jerrycainjr29-Jul-04 8:30 
GeneralRe: Converting a managed .NET System::String to an unmanaged, UTF-8 encoded, null-terminated char array Pin
palbano29-Jul-04 11:00
palbano29-Jul-04 11:00 
GeneralRe: Converting a managed .NET System::String to an unmanaged, UTF-8 encoded, null-terminated char array Pin
jerrycainjr30-Jul-04 10:07
jerrycainjr30-Jul-04 10:07 
GeneralQuestion about DLL imports - Fast Pin
Stanimir_Stoyanov24-Jul-04 20:20
Stanimir_Stoyanov24-Jul-04 20:20 
GeneralCOM Interop Question Pin
ursus zeta23-Jul-04 12:26
ursus zeta23-Jul-04 12:26 
GeneralFurther Adventures Pin
ursus zeta4-Aug-04 10:37
ursus zeta4-Aug-04 10:37 
Well, apparently, no one has any interest in this subject.
I've spent some time exploring the Word.dll assembly, and as it turns out the methods referred to in the above message were alot more easily implemented than I had originally thought. In the Word assembly (which is a huge library) in most of the methods that I've encountered so far, the Type Library Importer attaches a custom attribute (the MarshalAsAttribute) to the [in] parameters of the methods (which is a .NET object&) that apparently is type cast to an ordinary struct (not a struct contained within a VARIANT), so there was no need to write a custom marshaler for any of the data conversions. And, many of the parameters that are required for function calls on an interface or instantiated object are optional. However, the Visual C++ .NET compiler requires an object be supplied for these optional parameters (which override default settings). Weirdly enough, this is easily accomplished by casting Type::Missing to a System::Object using the dynamic_cast operator (or the __try_cast operator, if you'd rather handle the exceptions) and supplying this as the optional parameter. Example:

Object* OptionalParameter = dynamic_cast<Object*>(Type::Missing);

Where you want to supply a structure for one of the optional parameters, it must be boxed.
There is a help file supplied that describes the various objects that can be instantiated and the interfaces that can be used to make function calls. Unfortunately, the help file is written for Visual Basic programmers, and provides only minimal guidance in writing the C++ code. It does, however, tell you how to obtain the many objects, and essentially what functions you must implement to accomplish various tasks in the Word application.
So, as it turns out, Microsoft Word can be automated fairly easily.
GeneralPossible Memory Leak issues Pin
Anonymous23-Jul-04 5:19
Anonymous23-Jul-04 5:19 
GeneralFast question Pin
Oriocat22-Jul-04 10:50
Oriocat22-Jul-04 10:50 
GeneralRe: Fast question Pin
Daniel Turini22-Jul-04 10:57
Daniel Turini22-Jul-04 10:57 
Generalneed doctor to check this pice of code Pin
Oriocat22-Jul-04 9:58
Oriocat22-Jul-04 9:58 
GeneralProblem... Pin
Pazzuzu22-Jul-04 5:13
Pazzuzu22-Jul-04 5:13 
GeneralRe: Problem... Pin
palbano25-Jul-04 18:05
palbano25-Jul-04 18:05 
GeneralConverting ... Pin
User 91483322-Jul-04 3:59
User 91483322-Jul-04 3:59 
GeneralRe: Converting ... Pin
palbano25-Jul-04 18:04
palbano25-Jul-04 18:04 
GeneralWebService without ASP and IIS Pin
MyPaq22-Jul-04 2:08
MyPaq22-Jul-04 2:08 
GeneralGoing mad with this Pin
Pazzuzu21-Jul-04 6:11
Pazzuzu21-Jul-04 6:11 
GeneralRe: Going mad with this Pin
palbano21-Jul-04 17:28
palbano21-Jul-04 17:28 
GeneralRe: Going mad with this Pin
Pazzuzu22-Jul-04 0:07
Pazzuzu22-Jul-04 0:07 
QuestionHow to convert....... Pin
Pazzuzu21-Jul-04 4:09
Pazzuzu21-Jul-04 4:09 
GeneralVritual functions wapping Pin
Mostafa Mohamed20-Jul-04 2:12
Mostafa Mohamed20-Jul-04 2:12 
GeneralSystem::IO::File::Copy errors Pin
Chris Korzeniowski19-Jul-04 10:21
Chris Korzeniowski19-Jul-04 10:21 
GeneralRe: System::IO::File::Copy errors Pin
Chris Korzeniowski19-Jul-04 11:36
Chris Korzeniowski19-Jul-04 11:36 
GeneralMFC &amp; .NET Serialization Compatibility Pin
alexatn19-Jul-04 9:47
alexatn19-Jul-04 9:47 

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.