Here's a question that's mainly for you theoretical physicists and cosmologists (do I have an awful lot of annoying questions, or what ???):
And, I should preface it by saying that I only have an extremely bleak comprehension of the topic, so, I'm probably asking the wrong question, or phrasing it in the wrong context, or,...typically,...I'm just completely wrong about everything,...:dazzled:
Anyway,...the topic is Marshaling (as in):
Overview of Marshaling in C++, MSDN (https://msdn.microsoft.com/en-us/library/bb384865.aspx)
Interop Marshaling, MSDN (https://msdn.microsoft.com/en-us/library/eaw10et3(v=vs.110).aspx)
Marshaling Data with COM Interop, MSDN (https://msdn.microsoft.com/en-us/library/9f9f3yxf(v=vs.110).aspx)
.NET - COM Interoperability, CodeProject, 2003 (http://www.codeproject.com/Articles/5001/NET-COM-Interoperability)
...And, what I'm interested in is: what is the best method for writing either: a COM Callable Wrapper (https://msdn.microsoft.com/en-us/library/f07c8z1c(v=vs.110).aspx), or, Stub (https://msdn.microsoft.com/en-us/library/windows/desktop/ms694309(v=vs.85).aspx) and Proxy (https://msdn.microsoft.com/en-us/library/windows/desktop/ms686580(v=vs.85).aspx) interoperability Architecture interfaces that will connect and manage elements of native (MASM assembly) code, and either COM or .NET components (or, more likely both).
...And, as a bonus question: How can I reliably implement attributes (which are compiler features, I think),...maybe, as a really complex MACRO (or, hierarchy of MACROS) ??? As examples: IDL Attributes, MSDN (https://msdn.microsoft.com/en-us/library/8tesw2eh.aspx),...and,...COM Attributes, MSDN (https://msdn.microsoft.com/en-us/library/3c3t8ddh.aspx).
From the cosmology point of view the answer is very simple. Just wait a while. In 5 billion years the sun will become a red giant, Earth will be destroyed, and none of this will matter. You may object: human race will survive on other planets, circling other suns. Well in that case wait a bit longer (100 billion years maybe), Universe is expected to die a "heat death". When there are no molecules left within light years of each other, again, you won't have to worry about this. Perhaps that's too long a time frame? Well, within a mere 100 million years we'll probably be hit by a large meteor, destroying all Windows computers, so that takes care of that problem.
Bottom line, from the theoretical cosmology point of view, Marshaling can simply be ignored. Seems the easiest solution, doesn't it?
:biggrin:
But will the last computers be running Windows Multidimensional Universe Ultimate ?
So only computers with Windows operating system will be destroyed ?
I'm on the safe side having Linux on my machine :biggrin:
Most theoretical cosmologists don't believe in a benevolent God. But I'm sure they'd all agree that IF such a person exists, then only Windows computers will be destroyed. Linux computers will be preserved in a giant Ark. Unfortunately the very existence of Windows pretty much proves we live in a random, meaningless Universe that doesn't care about us at all. In that case expect the worst: possibly ONLY Windows Multidimensional Universe Ultimate version 10 computers will survive! Linux and Windows 7 pro computers will be right at ground zero when the meteor hits.
Bottom line, given this pessimistic view, what difference does Marshaling really make? Might as well just have a cold beer, watch the tube, wait for death, and vote for Trump.
WELL,...that's what I get for asking a question like that. :dazzled:
Quote from: GOD...from the theoretical cosmology point of view, Marshaling can simply be ignored,...
...RRR314159 (and, HUTCH),...you guys are hilarious !!! Apparently,...
God DOES have a sense of humor,...
...This is kinda disappointing,...though,...from the perspective of my current project...
I can see that indiscriminate, non-denominational, neutrino-based Marshaling is the only rational course of action here,... :dazzled:
With any luck the best course of action is to wait for someone who knows about marshalling (unlike myself) to provide some useful information :P
Quote from: rrr314159 on July 23, 2016, 06:54:44 AMFrom the cosmology point of view the answer is very simple. Just wait a while. In 5 billion years the sun will become a red giant...
Thank you for putting this into perspective :t I've always wondered why right-clicking on a file takes ages, i.e. Billions of cycles to ask COM for displaying a list of options... it's the cosmology, stupid :icon_redface:
Quote from: rrr314159 on July 23, 2016, 07:41:30 AM
Most theoretical cosmologists don't believe in a benevolent God. But I'm sure they'd all agree that IF such a person exists, then only Windows computers will be destroyed. Linux computers will be preserved in a giant Ark. Unfortunately the very existence of Windows pretty much proves we live in a random, meaningless Universe that doesn't care about us at all. In that case expect the worst: possibly ONLY Windows Multidimensional Universe Ultimate version 10 computers will survive! Linux and Windows 7 pro computers will be right at ground zero when the meteor hits.
Bottom line, given this pessimistic view, what difference does Marshaling really make? Might as well just have a cold beer, watch the tube, wait for death, and vote for Trump.
I am liking the cold beer and watch the tube part of your platform,BUT I would use Trump as a first test to stop the giant meteor,if he does not survive,nothing lost..grabs another beer and watches South park as I wait for the end...
...For those of you that are not: COSMOLOGISTS,...
I've found lots of information about Marshaling (both COM and .NET),...I can post these if there's any interest,...:dazzled:
But,...I've also made two MAJOR discoveries:
- I'm an Idiot.
- My defunct application: COM CoreFluxWarp (http://masm32.com/board/index.php?topic=4394.0) provides lots of information about .NET Framework classes (actually their implemented COM interfaces) that expose .NET methods for creating attributes and Marshaling attributes. You just have to scroll down to each entry that has mscoree.dll as it's COM In-Proc server, and double-click the entry.
For example: (these are the associated registry keys for the In-Proc server -- mscoree.dll -- System.Runtime.InteropServices namespace)
[.NET Framework Class]
COM Class CLSID: {96A058CD-FAF7-386C-85BF-E47F00C81795}
Value: [Default] = System.Runtime.InteropServices.InAttribute
SubKey: Implemented Categories
SubKey: InprocServer32
Value: Class = System.Runtime.InteropServices.InAttribute
Value: = mscoree.dll
Value: ThreadingModel = Both
Value: Assembly = mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Value: RuntimeVersion = v1.1.4322
SubKey: ProgId
Value: = System.Runtime.InteropServices.InAttribute
...and,...
[.NET Framework Class]
COM Class CLSID: {FDB2DC94-B5A0-3702-AE84-BBFA752ACB36}
Value: [Default] = System.Runtime.InteropServices.OutAttribute
SubKey: Implemented Categories
SubKey: InprocServer32
Value: Assembly = mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Value: Class = System.Runtime.InteropServices.OutAttribute
Value: = mscoree.dll
Value: RuntimeVersion = v1.1.4322
Value: ThreadingModel = Both
SubKey: ProgId
Value: = System.Runtime.InteropServices.OutAttribute
...And,...yes,...these two interface vtables can be instantiated with either: CoCreateInstance or a COM Class Moniker,...
See google book : .NET 2.0 Interoperability Recipes: A Problem-Solution Approach by Bruce Bukovics
Chapter 7 describes In / Out attributes
In the January, 2008 issue of MSDN Magazine there is an article: Marshaling between Managed and Unmanaged Code, by Yi Zhang and Xiaoying Guo, which describes how [InAttribute] and [OutAttribute] control marshaling between unmanaged and managed code.
Quote from: Yi Zhang and Xiaoying Guo...When applying to method parameters and return values, these attributes control marshaling direction, so they're known as directional attributes. [InAttribute] tells the CLR to marshal data from the caller to the callee at the beginning of the call, while [OutAttribute] tells the CLR to marshal back from the callee to the caller upon return. Both the caller and the callee can be either unmanaged or managed code,...
...These attributes would be fairly easy to implement in MASM assembly,...just by following the conventions of normal .NET marshaling,...
Some of the other .NET attributes, like [PreserveSigAttribute], [StructLayoutAttribute] and [MarshalAs(UnmanagedType], I have no idea how to implement in MASM assembly,...
Here is a listing of: .NET Framework Attributes, MSDN (https://msdn.microsoft.com/en-us/library/system.attribute.aspx)
Here is an article about .NET attributes: Defining and Using Custom Attribute Classes in C#, Code Magazine (http://www.codemag.com/article/0307041)
...And, here is another article:Creating and Using Attributes in Your .NET Application, CodeProject (http://www.codeproject.com/Articles/1811/Creating-and-Using-Attributes-in-your-NET-applicat)
Quote from: Zen on July 26, 2016, 04:19:13 AM
In the January, 2008 issue of MSDN Magazine there is an article: Marshaling between Managed and Unmanaged Code, by Yi Zhang and Xiaoying Guo, which describes how [InAttribute] and [OutAttribute] control marshaling between unmanaged and managed code.
...
Got it here (http://web.archive.org/web/20080128144432/http://msdn.microsoft.com/msdnmag/issues/08/01/CLRInsideOut/default.aspx)
Maybe in October when I hopefully get back to programming I'll continue this challenging quest
The whole Marshaling thing smacks of the nanny state of matter,and bigger and more intrusive atoms.(yes that was a little humor,very little)
Hi
ZenQuote from: Zen on July 26, 2016, 04:19:13 AM
...These attributes would be fairly easy to implement in MASM assembly,...just by following the conventions of normal .NET marshaling,...
Some of the other .NET attributes, like [PreserveSigAttribute], [StructLayoutAttribute] and [MarshalAs(UnmanagedType], I have no idea how to implement in MASM assembly,...
Here is a listing of: .NET Framework Attributes, MSDN (https://msdn.microsoft.com/en-us/library/system.attribute.aspx)
Here is an article about .NET attributes: Defining and Using Custom Attribute Classes in C#, Code Magazine (http://www.codemag.com/article/0307041)
...And, here is another article:Creating and Using Attributes in Your .NET Application, CodeProject (http://www.codeproject.com/Articles/1811/Creating-and-Using-Attributes-in-your-NET-applicat)
It varies depending on the purpose of the use it
for example:
use it in
managed code when you need to be specific regarding how your
.NET type will be exposed to
COM, or when you need to be specific regarding how COM Class will be import from COM
System.Runtime.InteropServices Attribute Equivalent to
COM IDL Def{Managed:
System.Runtime.InteropServices.InAttribute} = {UnManaged:COM IDL parametre attribut
[In] }
{Managed:
System.Runtime.InteropServices.OUTAttribute}={UnManaged:COM IDL parametre attribut
[Out] }
Also you can use System.Runtime.InteropServices Attribute in
UnManaged code (like MASM) if you want to create Dynamic Assembly (Define
Dynamic Assembly,
TypeBuilder ,
MethodBuilder ,... ) or if you want to create
Delegate
MABDELOUAHAB,
Yeah,...I've been reading up on the various attributes (both COM IDL and .NET), and, in general, the authors describe how the attributes affect the type, or, the operation. I have much to learn, though.
Zen,
Today I've discovered one valuable VIDEO resource that can help you to understand all INs and OUTs
of Marshaling better : CLICK ME ;) (https://www.youtube.com/channel/UCW7ck0jRwnXqmShjGdsaoPA)
About all this unnecessarily complicated subject :
Quote"Any intelligent fool can make things bigger,more complex, and more violent.
It takes a touch of genius -- and a lot of courage --to move in the opposite direction."
E. F. Schumacher
Quote taken from Bogdan Ontanu's website.
Quote from: Vortex on July 28, 2016, 02:43:57 AM
About all this unnecessarily complicated subject
I'm a great admirer of E.F. Schumacher :P
Quote from: E. F. SCHUMACHER"Any intelligent fool can make things bigger,more complex, and more violent.
It takes a touch of genius -- and a lot of courage --to move in the opposite direction."
...Well,...I'm certainly not a genius,...
Quote from: Zen on July 29, 2016, 05:18:38 AM
Quote from: E. F. SCHUMACHERr"Any intelligent fool can make things bigger,more complex, and more violent.
It takes a touch of genius -- and a lot of courage --to move in the opposite direction."
...Well,...I'm certainly not a genius,...
We are on the same boat. No need to be a genius to understand the quote from E. F. Schumacher