clr

How to move/copy data from MFC to C++/CLI using events/delegates/callback

岁酱吖の 提交于 2019-12-12 03:49:58
问题 We have a MFC application setup where a client receives data from server whenever new data is available. Client is being rewritten in C# but communication with server part is in MFC. We have written a C++/CLI wrapper to classes associated with MFC and are able to receive data on application initialization. Communication engine is still in MFC and we have created wrapper classes only for data items. When we initialize the CLI wrapper we copy the data from MFC arrays to CLI arrays. But am not

c++/clr StructureToPtr Stack buffer overflow

给你一囗甜甜゛ 提交于 2019-12-12 03:25:48
问题 as I have asked in this question c++/clr StructureToPtr exit application without any exception or error and thanks to the comment, I found out the exit code is -1073740791 , which means Stack buffer overflow / overrun. So let me post my two structures, [StructLayout(LayoutKind::Sequential)] public ref struct ThostFtdcInputOrderField { [MarshalAs(UnmanagedType::ByValTStr, SizeConst = 11)] String^ BrokerID; [MarshalAs(UnmanagedType::ByValTStr, SizeConst = 13)] String^ InvestorID; [MarshalAs

C++ wrapper class for C# class calling a web service

廉价感情. 提交于 2019-12-12 02:32:50
问题 So, I've written a web service in c#, which has a method for signing a hash. This web service is a WCF Service application. Then, I've created a c# Console application where I've written a function to consume this web service. The declaration of the function which calls the web service is that: class Program { public byte[] callWS(string alias, byte[] myHash,string myPassword) { IhashSignSVCClient client = new IhashSignSVCClient(); byte[] signedData= client.SignandReturn(alias, myhash,

c++/clr StructureToPtr exit application without any exception or error

空扰寡人 提交于 2019-12-12 01:53:48
问题 I have a piece of code that transform a managed object into unmanaged object as per below, static void M2N(M managed, N* pNative){ Marshal::StructureToPtr(managed, IntPtr(pNative), true); }; my problem is after calling the above piece of code on certain struct , the code exits mysteriously without any exception, the tranformation is obviously unsuccessful (I have tried with some other struct, it works). My question is how can I at least produce some exception, so that I know where went wrong?

How is the .net referenced assemblies names resolved by the clr at runtime?

有些话、适合烂在心里 提交于 2019-12-12 01:26:33
问题 when my .net exe runs, it loads the correct .net assemblies at rumtime. i understand that there is a probing process that happens. my question is that if i open up the .net exe/dll in ildasm, i only the .extern reference to the mscorlib.dll, not others. so how does clr gets the information required for doing the probing of the .net referenced assemlies? i have an example project and the images here. so in this case, i dont see the .net assembly references anywhere like System, System.Xml.Linq

SQL CLR function showing error when i am fetching data from Sharepoint 2010 Webservices

烂漫一生 提交于 2019-12-11 21:29:47
问题 Hi am fetching data from sharepoint 2010 list by asmx webservices but when i there is no data in any column it says below error on sql: Lets says "ows_ClientContactPerson" column has not any record then it will give me below error if has then it will not give me error.. Msg 6260, Level 16, State 1, Line 2 An error occurred while getting new row from user defined Table Valued Function : System.ArgumentException: Column 'ows_ClientContactPerson' does not belong to table row. System

Load different version of assembly into separate AppDomain

余生长醉 提交于 2019-12-11 20:40:06
问题 I'm implementing application that supports plugins. Currently the problem arises when I try to load common assembly that is used both by host application and plugin: host application should use one version of that assembly, while plugin uses another version. This is dictated by application upgrade process - plugin can be updated separately from host application. Every assembly is signed, so I use strong names for loading assemblies. I created a test application which demonstrates the problem.

LNK1112 on Directshow C++ CLR project

丶灬走出姿态 提交于 2019-12-11 19:16:50
问题 i am trying to rebuild a program in CLR C++ from C++ and i get the linker error 1>strmbasd.lib(strmiids.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' my project is set to Win32 and the properties are set to target machine x86. i keep rebuilding baseclasses to match the Win32 and I don't know where or why its failing Linker command line looks like: /OUT:"C:\Users\ME\Documents\Code\X C++\Trial2\DirectshowC++\Debug\DirectshowC++.exe" /INCREMENTAL

SQL Server 2008 RegEx CLR Use

北城余情 提交于 2019-12-11 17:59:12
问题 OK, I realize that SS 2008 doesn't have native regex functions. I also see that it's possible to add them using CLR. I found the regex CLR at http://msdn.microsoft.com/en-us/magazine/cc163473.aspx , but I don't know what to do with them. So I have 2 questions. The regex is only used when importing records (up to 1,000,000 at a time, and up to 50,000,000 a year) against 2 fields. 1st question. I can do it manually 1 record at a time in my code (ASP.NET), and I know it would be a performance

.NET assemblyBinding configuration ignored in machine.config

偶尔善良 提交于 2019-12-11 17:39:38
问题 I have a situation where I need to be able to load assemblies in the GAC based on their partial names. In order to do this I have added the following to my app.config file: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <qualifyAssembly partialName="MyAssembly" fullName= "MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0123456789abcdef"/> </assemblyBinding> </runtime> This works exactly the way I want it to. However, if I place the same element in my machine