dllimport

System.EntryPointNotFoundException and DllImport("kernel32.dll")

Hi, Why have I a EntryPointNotFoundException in this code. (source pinvoke.net) My OS is Windows XP SP3. using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace System_Info { class Program { [DllImport("kernel32.dll", SetLastError = false)] static exter...

Problems adding DLL to C# project in visual studio, getting a TryLoadException at runtime

I'm sorry if this is a dumb question, but I've been trying for hours with no luck , and maybe one of you can help. I have a class/library project I made in Visual Studio, a Spreadsheet in the SS namespace. Next, I created a windows form application, I then added the DLL, and put it in my resources menu, and it builds just fine, however...

Do I need to rebuild against a dll, if its exports have not changed?

This is probably a very stupid question. But assume that I have a DLL (test.dll), with some exports, that when built generates an import library (test.lib). I have an application TestApp that uses this DLL. Now, if I want to change some functions' implementation in the DLL, and I keep the exports unchaged, do I need to rebuild my applic...

C# dll that can be pinvoked?

Question: Is it possible to write a C# dll that can be pinvoked ? I want to write a replacement library for the WinAPI calls WritePrivateProfileString etc. for reading and writing ini files. Is it possible to export a function, e.g. 'WritePrivateProfileString', implemented in C# so one can pinvoke the dll with DllImport ? I want to re...

StringList for c sharp in Dllimport

Hi , I am working on c sharp.I need to use an API exported from an unmanaged dll. The API in the dll is using Stringlist* as datatype for one argument. How can I define my DllImport in the C sharp project so that I can comfortably pass the equivalent data from c sharp to the unmanaged code. I tried using List, ArrayList, string[]. None...

Getting System Idle Time with Qt

I'm new to Qt as of a few weeks ago. I'm trying to rewrite a C# application with C++ and have a good portion of it figure now. My current challenge is finding a way to detect the system idle time. With my C# application, I stole code from somewhere that looks like this: public struct LastInputInfo { public uint cbSize; public u...

Using MinGW built dll in a Visual Studio 2010 C++ project

Hi, I have build a dll and now I want to use this dll in a Microsoft Visual Studio project. g++ -O0 -Wall -c -fmessage-length=0 -osrc\MyLib.o ..\src\MyLib.cpp g++ -shared -Wl,--out-implib=MyLib.lib -Wl,--output-def=MyLib.def -oMyLib.dll src\MyLib.o -lwsock32 The dll works fine when I use it in a "gcc project". I have tried different ...

C# Marshalling char** and unsigned char**

Hello, all. Here is the problem - i have some C image processing library that i need to use from C# application. Lack of experience with DllImport strikes me hard for now. The function i need to use looks like: IMAGEPROCESS_API const int importImage ( const unsigned char* image, const char* xmlInput, ...

Cannot access a Linux gcc compiled .so shared library from Windows Mono C# Project

Here's the setup: I've got a shared library (c++ with extern "C" methods) I've compiled in linux and created a library.so file. I've used Mono Develop on the same box (Ubuntu) and was able to DLLImport("library.so") and access my extern functions no problem. The problem comes in when I copied that .so file to a windows machine (Win7) ...

How to dllimport in C++

I have a DLL and I would like to use some of its functions. #include <iostream> using namespace std; extern "C" __declspec(dllimport) int Initialize(char* localPort, char* adminServerName, int rpcTimeout); int main() { int res = Initialize("7864", "6000@kabc", 10000); return 0; } I don't have the DLL's .lib file, so is th...

Can I use c++ to traverse DOM from C# BHO?

Hi! I'm writing a Browser Helper Object (BHO) for Internet Explorer in C#! I want to look for text nodes in the DOM, which requires me to traverse the whole DOM tree if I want to differentiate between text nodes and other types of nodes. This is supposedly time consuming in C#, but should be almost instantanious in C++ (?). Is there a...