Click here to Skip to main content
15,892,298 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Unmanaged Hosting of .NET Framework Version 4 Pin
Super Lloyd5-Jul-16 16:08
Super Lloyd5-Jul-16 16:08 
AnswerRe: Unmanaged Hosting of .NET Framework Version 4 Pin
Super Lloyd5-Jul-16 19:55
Super Lloyd5-Jul-16 19:55 
GeneralRe: Unmanaged Hosting of .NET Framework Version 4 Pin
Derek Tortonian6-Jul-16 10:27
Derek Tortonian6-Jul-16 10:27 
GeneralRe: Unmanaged Hosting of .NET Framework Version 4 Pin
Super Lloyd6-Jul-16 13:25
Super Lloyd6-Jul-16 13:25 
GeneralRe: Unmanaged Hosting of .NET Framework Version 4 Pin
Derek Tortonian7-Jul-16 8:50
Derek Tortonian7-Jul-16 8:50 
GeneralRe: Unmanaged Hosting of .NET Framework Version 4 Pin
Super Lloyd7-Jul-16 14:35
Super Lloyd7-Jul-16 14:35 
GeneralRe: Unmanaged Hosting of .NET Framework Version 4 Pin
Derek Tortonian8-Jul-16 10:05
Derek Tortonian8-Jul-16 10:05 
GeneralPROBLEM SOLVED Pin
Derek Tortonian13-Jul-16 10:08
Derek Tortonian13-Jul-16 10:08 
I'm posting this just in case someone out there in the galaxy has a similar problem. Big Grin | :-D
As it turns out, I had the correct approach, but, I made a simple mistake (an incorrect assumption).
If you open the mscorlib Type Library in the OLE/COM Object Viewer, and select one of the COM interfaces, it will produce the IDL code of the interface virtual function table's implemented methods in the correct vtable order. I did this, for example, with the System.Reflection._Assembly interface that exposes the public members of the System.Reflection.Assembly class to unmanaged code. What I didn't notice was that the System.Reflection._Assembly interface was derived from IDispatch, instead of IUnknown, like I was assuming. IUnknown has three methods and IDispatch has four methods (in addition to IUnknown's three methods),...so, my count of the offset to the correct COM method implementation function pointer within the interface vtable was off by 4x4bytes. Embarrassing,...
...Just for some serious overkill, here is the IDL output of the System.Reflection._Assembly interface (from OLE/COM Object Viewer):
[
  odl,
  uuid(17156360-2F1A-384A-BC52-FDE93C215C5B),
  version(1.0),
  dual,
  oleautomation,
    custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "System.Reflection.Assembly")

]
interface _Assembly : IDispatch {
    [id(00000000), propget,
        custom({54FC8F55-38DE-4703-9C4E-250351302B1C}, "1")]
    HRESULT ToString([out, retval] BSTR* pRetVal);
    [id(0x60020001)]
    HRESULT Equals(
                    [in] VARIANT other, 
                    [out, retval] VARIANT_BOOL* pRetVal);
    [id(0x60020002)]
    HRESULT GetHashCode([out, retval] long* pRetVal);
    [id(0x60020003)]
    HRESULT GetType([out, retval] _Type** pRetVal);
    [id(0x60020004), propget]
    HRESULT CodeBase([out, retval] BSTR* pRetVal);
    [id(0x60020005), propget]
    HRESULT EscapedCodeBase([out, retval] BSTR* pRetVal);
    [id(0x60020006)]
    HRESULT GetName([out, retval] _AssemblyName** pRetVal);
    [id(0x60020007),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetName")]
    HRESULT GetName_2(
                    [in] VARIANT_BOOL copiedName, 
                    [out, retval] _AssemblyName** pRetVal);
    [id(0x60020008), propget]
    HRESULT FullName([out, retval] BSTR* pRetVal);
    [id(0x60020009), propget]
    HRESULT EntryPoint([out, retval] _MethodInfo** pRetVal);
    [id(0x6002000a),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetType")]
    HRESULT GetType_2(
                    [in] BSTR name, 
                    [out, retval] _Type** pRetVal);
    [id(0x6002000b),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetType")]
    HRESULT GetType_3(
                    [in] BSTR name, 
                    [in] VARIANT_BOOL throwOnError, 
                    [out, retval] _Type** pRetVal);
    [id(0x6002000c)]
    HRESULT GetExportedTypes([out, retval] SAFEARRAY(_Type*)* pRetVal);
    [id(0x6002000d)]
    HRESULT GetTypes([out, retval] SAFEARRAY(_Type*)* pRetVal);
    [id(0x6002000e)]
    HRESULT GetManifestResourceStream(
                    [in] _Type* Type, 
                    [in] BSTR name, 
                    [out, retval] _Stream** pRetVal);
    [id(0x6002000f),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetManifestResourceStream")]
    HRESULT GetManifestResourceStream_2(
                    [in] BSTR name, 
                    [out, retval] _Stream** pRetVal);
    [id(0x60020010)]
    HRESULT GetFile(
                    [in] BSTR name, 
                    [out, retval] _FileStream** pRetVal);
    [id(0x60020011)]
    HRESULT GetFiles([out, retval] SAFEARRAY(_FileStream*)* pRetVal);
    [id(0x60020012),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetFiles")]
    HRESULT GetFiles_2(
                    [in] VARIANT_BOOL getResourceModules, 
                    [out, retval] SAFEARRAY(_FileStream*)* pRetVal);
    [id(0x60020013)]
    HRESULT GetManifestResourceNames([out, retval] SAFEARRAY(BSTR)* pRetVal);
    [id(0x60020014)]
    HRESULT GetManifestResourceInfo(
                    [in] BSTR resourceName, 
                    [out, retval] _ManifestResourceInfo** pRetVal);
    [id(0x60020015), propget]
    HRESULT Location([out, retval] BSTR* pRetVal);
    [id(0x60020016), propget]
    HRESULT Evidence([out, retval] _Evidence** pRetVal);
    [id(0x60020017)]
    HRESULT GetCustomAttributes(
                    [in] _Type* attributeType, 
                    [in] VARIANT_BOOL inherit, 
                    [out, retval] SAFEARRAY(VARIANT)* pRetVal);
    [id(0x60020018),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetCustomAttributes")]
    HRESULT GetCustomAttributes_2(
                    [in] VARIANT_BOOL inherit, 
                    [out, retval] SAFEARRAY(VARIANT)* pRetVal);
    [id(0x60020019)]
    HRESULT IsDefined(
                    [in] _Type* attributeType, 
                    [in] VARIANT_BOOL inherit, 
                    [out, retval] VARIANT_BOOL* pRetVal);
    [id(0x6002001a)]
    HRESULT GetObjectData(
                    [in] _SerializationInfo* info, 
                    [in] StreamingContext Context);
    [id(0x6002001b)]
    HRESULT add_ModuleResolve([in] _ModuleResolveEventHandler* value);
    [id(0x6002001c)]
    HRESULT remove_ModuleResolve([in] _ModuleResolveEventHandler* value);
    [id(0x6002001d),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetType")]
    HRESULT GetType_4(
                    [in] BSTR name, 
                    [in] VARIANT_BOOL throwOnError, 
                    [in] VARIANT_BOOL ignoreCase, 
                    [out, retval] _Type** pRetVal);
    [id(0x6002001e)]
    HRESULT GetSatelliteAssembly(
                    [in] _CultureInfo* culture, 
                    [out, retval] _Assembly** pRetVal);
    [id(0x6002001f),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetSatelliteAssembly")]
    HRESULT GetSatelliteAssembly_2(
                    [in] _CultureInfo* culture, 
                    [in] _Version* Version, 
                    [out, retval] _Assembly** pRetVal);
    [id(0x60020020)]
    HRESULT LoadModule(
                    [in] BSTR moduleName, 
                    [in] SAFEARRAY(unsigned char) rawModule, 
                    [out, retval] _Module** pRetVal);
    [id(0x60020021),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "LoadModule")]
    HRESULT LoadModule_2(
                    [in] BSTR moduleName, 
                    [in] SAFEARRAY(unsigned char) rawModule, 
                    [in] SAFEARRAY(unsigned char) rawSymbolStore, 
                    [out, retval] _Module** pRetVal);
    [id(0x60020022)]
    HRESULT CreateInstance(
                    [in] BSTR typeName, 
                    [out, retval] VARIANT* pRetVal);
    [id(0x60020023),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "CreateInstance")]
    HRESULT CreateInstance_2(
                    [in] BSTR typeName, 
                    [in] VARIANT_BOOL ignoreCase, 
                    [out, retval] VARIANT* pRetVal);
    [id(0x60020024),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "CreateInstance")]
    HRESULT CreateInstance_3(
                    [in] BSTR typeName, 
                    [in] VARIANT_BOOL ignoreCase, 
                    [in] BindingFlags bindingAttr, 
                    [in] _Binder* Binder, 
                    [in] SAFEARRAY(VARIANT) args, 
                    [in] _CultureInfo* culture, 
                    [in] SAFEARRAY(VARIANT) activationAttributes, 
                    [out, retval] VARIANT* pRetVal);
    [id(0x60020025)]
    HRESULT GetLoadedModules([out, retval] SAFEARRAY(_Module*)* pRetVal);
    [id(0x60020026),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetLoadedModules")]
    HRESULT GetLoadedModules_2(
                    [in] VARIANT_BOOL getResourceModules, 
                    [out, retval] SAFEARRAY(_Module*)* pRetVal);
    [id(0x60020027)]
    HRESULT GetModules([out, retval] SAFEARRAY(_Module*)* pRetVal);
    [id(0x60020028),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "GetModules")]
    HRESULT GetModules_2(
                    [in] VARIANT_BOOL getResourceModules, 
                    [out, retval] SAFEARRAY(_Module*)* pRetVal);
    [id(0x60020029)]
    HRESULT GetModule(
                    [in] BSTR name, 
                    [out, retval] _Module** pRetVal);
    [id(0x6002002a)]
    HRESULT GetReferencedAssemblies([out, retval] SAFEARRAY(_AssemblyName*)* pRetVal);
    [id(0x6002002b), propget]
    HRESULT GlobalAssemblyCache([out, retval] VARIANT_BOOL* pRetVal);
};


modified 13-Jul-16 16:17pm.

GeneralRe: PROBLEM SOLVED Pin
Super Lloyd13-Jul-16 17:50
Super Lloyd13-Jul-16 17:50 
GeneralRe: PROBLEM SOLVED Pin
Derek Tortonian15-Jul-16 13:10
Derek Tortonian15-Jul-16 13:10 
GeneralRe: PROBLEM SOLVED Pin
Super Lloyd15-Jul-16 17:02
Super Lloyd15-Jul-16 17:02 
QuestionDapper Query Async calling a stored procedures with parameters Pin
DotNetFellow29-Jun-16 3:43
DotNetFellow29-Jun-16 3:43 
AnswerRe: Dapper Query Async calling a stored procedures with parameters Pin
Richard Deeming29-Jun-16 3:55
mveRichard Deeming29-Jun-16 3:55 
AnswerRe: Dapper Query Async calling a stored procedures with parameters Pin
Pratik_Scott30-Jun-16 6:47
Pratik_Scott30-Jun-16 6:47 
QuestionCode special to MVC Pin
larsp77728-Jun-16 2:13
larsp77728-Jun-16 2:13 
AnswerRe: Code special to MVC Pin
Dave Kreskowiak28-Jun-16 2:37
mveDave Kreskowiak28-Jun-16 2:37 
GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 2:46
larsp77728-Jun-16 2:46 
GeneralRe: Code special to MVC Pin
Richard Deeming28-Jun-16 3:10
mveRichard Deeming28-Jun-16 3:10 
GeneralRe: Code special to MVC Pin
Dave Kreskowiak28-Jun-16 3:40
mveDave Kreskowiak28-Jun-16 3:40 
GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 3:44
larsp77728-Jun-16 3:44 
GeneralRe: Code special to MVC Pin
Dave Kreskowiak28-Jun-16 3:50
mveDave Kreskowiak28-Jun-16 3:50 
GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 4:00
larsp77728-Jun-16 4:00 
GeneralRe: Code special to MVC Pin
larsp77728-Jun-16 3:48
larsp77728-Jun-16 3:48 
GeneralRe: Code special to MVC Pin
Dave Kreskowiak28-Jun-16 4:39
mveDave Kreskowiak28-Jun-16 4:39 
AnswerRe: Code special to MVC Pin
Richard Deeming28-Jun-16 3:12
mveRichard Deeming28-Jun-16 3:12 

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.