unmanaged

Where does DLLImport look for unmanaged DLLs?

橙三吉。 提交于 2020-01-10 18:54:07
问题 A quick question: When declaring the DLLImport Attribute in .Net, where does the runtime look to resolve that DLL dependency? Would I have to dump the DLL and all of its dependencies in the bin folder? 回答1: I think it is working like LoadLibrary. Maybe Windows path searching in LoadLibrary with manifest will be helpfull. Edit Dynamic-Link Library Search Order is probably what you want. 回答2: Generally, you'd expect it to look at whatever's defined in the user's Path. To find out what this

C++: Getting the “error C2065: 'pst' : undeclared identifier” while using pstsdk?

假装没事ソ 提交于 2020-01-07 04:08:12
问题 Following the suggestion of working with the pstsdk in this question: Processing Microsoft Office Outlook 2003/2007 email messages… And following the instructions here: PST File Format SDK - PST Layer Overview - Getting Started And also according to this video: In PST SDK Presentation, Terry Mahaffey, discusses the PST SDK file format SDK. (Forward it to 28:32) They all agree that I only have to include the PST header file after having properly added the include paths for both Boost and

c++ lnk 2028, lnk 2020, lnk 2019 and lnk 2001 when importing dll

大城市里の小女人 提交于 2020-01-05 19:07:30
问题 A few day ago I asked a similar question, which helped me look in the right direction with __declspec(), but I got stuck again. I'll be as clear as possible. Hopefully someone can tell me what I'm doing wrong. It is probably something small and simple. Projects info: jc: project type: Class Library configuration type: Dynamic Library (.dll) common runtime language support: /clr references: System System.Data System.Drawing System.Windows.Forms System.Xml test (start up project): project type:

Unmanaged DLL Export with Robert Giesecke Library Not Working Under Windows XP

偶尔善良 提交于 2020-01-05 07:59:30
问题 I have a pure C# dll that I compiled using Unmanaged DLL Export / Robert Giesecke which compiles successfully and can be called from a C++ application when running on Windows 7. The DLL is compiled for Win32 (x86). Then the same program and DLL are run on a windows XP machine the executable program cannot call the exported DLL function. here is an example of the exported function: [DllExport("SetTerminalHandle", CallingConvention = CallingConvention.Cdecl)] public static void

C# Proper Disposing of Structure with Char*

吃可爱长大的小学妹 提交于 2020-01-05 04:07:26
问题 I'm quite new to C# and I'm having trouble releasing unmanaged resource. For the function CharPtrToString, is it necessary to release IntPtr? In addition, would it be safe to call List < MyStruct >.clear() without causing a memory leak? public string CharPtrToString(MycharArray chararray) { IntPtr ipp = (IntPtr)chararray; string s = Marshal.PtrToStringAnsi(ipp) //need to free Ipp? return s; } public struct MyStruct { public Int int1; public MyCharArray charArray; } public unsafe struct

Stuck on calling convention calling Managed CLI method from unmanaged C++

让人想犯罪 __ 提交于 2020-01-04 09:38:10
问题 I am trying to call a managed method from unmanaged code. However, the managed code is requiring that I use the '(__clrcall) calling convention, and my unmanaged C++ code refuses to let me use the __clrcall calling convention without using the /clr option. I don't believe I want to do that as the unmanaged project is not mine to change to managed. I have gone through constructing all those delegates and function pointer marshaling in the managed side as I have seen on CodeGuru and MSDN but

Load Library/Module from Memory

元气小坏坏 提交于 2020-01-04 08:15:10
问题 I realized a little C# porting of this application that allows to load libraries from memory/stream instead of using LoadLibrary API function that works through filesystem. After messing around a little bit with pointers and mimatching results... finally I have something working as intended. The only problem I have is that the call to DLLMain always fails (I tried it with Kernel32.dll and User32.dll). I can't understand why and I don't know how to debug the issue. Here is the main function of

Can one prevent Microsoft Error Reporting for a single app?

放肆的年华 提交于 2020-01-03 11:10:09
问题 We have an unmanaged C++ application that utilizes 3rd party APIs to read CAD files. On certain corrupted CAD files, the 3rd party library crashes and brings our EXE down with it. Because of this our main application is a separate EXE and in this way it does not get affected by the crash. Howevever, we end up with annoying Microsoft Error Reporting dialogs. I do not want to disable Microsoft Error Reporting system wide. Is there a way to turn off error reporting for a single application, so

ITaskbarList3 undeclared?

北城余情 提交于 2020-01-03 00:38:25
问题 I'm trying to write some c++ code to use the ITaskbarList3, but I'm getting that error. I have confirmed that I am including shobjidl.h (but I checked and this file only defines up to ITaskbarList2). I have Visual Studios 2008 (SP1) and I have Microsoft Windows SDK for Windows Server 2008 installed. Does anyone know what I am missing? 回答1: You need to install the Windows 7 SDK. That has an update shobjidl.h with ITaskbarList3. 回答2: Or you can adapt the content of Windows 7 SDK related to

Simulate Keyboard Event on Windows Mobile

ぃ、小莉子 提交于 2020-01-01 16:58:31
问题 Please refer to the screenshot below: The datetime control is a Compact Framework DateTimePicker, the numbered buttons are stndard Button controls. Clicking on the arrow of the DateTimePicker displays a calendar control allowing the suer to select a date. However if the user clicks on any part of the selected Text date it is highlighted and can be amended using either the hard keys or the on-screen keyboard. I'm trying to emulate this functionality with my standard buttons. I've have tried