dll

Problem with Marshalling char* in c#

I have a problem calling this function from a c++ DLL in c# INT32 WINAPI PM_COM_GetText(INT32 TextId, char* pBuf, INT32 BufSize); It writes a Text in a buffer for a given text id. I try to call it with the following c# code, but I constantly get an access violation and don't undrestand why: public string GetText(Int32 TextId) { Int...

Handling Messages in Console Apps/DLLs in C++ Win32

I would like to have the ability to process Win32 messages in a console app and/or inside a standalone DLL. I have been able to do it in .NET with the following article and it works great in C# inside a console app and standalone DLL http://msdn.microsoft.com/en-us/magazine/cc163417.aspx Is there a way to do the equivalent with C/C++ W...

PInvoke Unbalances the stack

Good afternoon, I have been working on a dll that can use CORBA to communicate to an application that is network aware. The code works fine if I run it as a C++ console application. However, I have gotten stuck on exporting the methods as a dll. The methods seems to export fine, and if I call a method with no parameters then it works...

Windows Process : Tool to see Function and change arguments

Sometime back I used a windows tool to see what a process is doing. This tool allowed me to inspect functions exported from DLL. It also allowed me to change the values passed to a function on the fly. I cannot recollect the name(not sure if that was free or commercial one). Could any one point to me solution that can do this? (Tools ...

Returning from dll (Asynchronous sockets)

I am trying to do a simple http-server in (c++) dll-file that I can use from managed (C#) application with P/Invoke. I was trying to do this with asynchronous functions (WSAAsyncSelect() and stuff), so that I could manage server by calling functions inside dll whenever needed and after that it would return to my main program. Now I'm not...

How to call function CreateProcess in Delphi Prism?

I wrote function CreateProcess( lpApplicationName:String; lpCommandLine:String; lpProcessAttributes:IntPtr; lpThreadAttributes:IntPtr; bInheritHandles:Boolean; dwCreationFlags:Int32; lpEnvironment:IntPtr; lpCurrentDirectory:IntPtr; ...

Reference a GNU C (POSIX) DLL built in GCC against Cygwin, from C#/NET

Here is what I want: I have a huge legacy C/C++ codebase written for POSIX, including some very POSIX specific stuff like pthreads. This can be compiled on Cygwin/GCC and run as an executable under Windows with the Cygwin DLL. What I would like to do is build the codebase itself into a Windows DLL that I can then reference from C# and w...

Problem using C++ DLL functions in C# code

[DllImport(pathimportdll)] static extern int InitiateSession(ref _SESSION_INFO sinfo, ref _DEVICE_INFO pDevInfo); [DllImport(pathimportdll)] static extern int StartAcquisition(); DLL functions are imported properly. After the call, application is asserting in tcscpy.inl with the message Expression: (L"Buffer is too small" && 0). ...

How does PATH environment affect my running executable from using msvcr90 to msvcr80 ???

#include <gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); gtk_main (); return 0; } I tried putting various versions of MSVCR80.dll under the same directory as the generated executable(via cm...

WSDL vs DLL. Which is better?

I would like to create a reusable interface to transfer some proprietary information over the TCP/IP connection. If given only the choice of either Web Services or distributing a pre-compiled Assembly, what are the pros and cons of using each? This is assuming that Windows OS is used. ...

adding a dll to a VS 2008 Win32 application

Hi, I have created a project VC++ in VS 2008. I want to call a certain function in an external dll. How can I add the reference/resource [I am a java guy please forgive if I am using the wrong terms here] to my project so that I can call the functions in the dll. I have gone through several forums and yet have not found a clear solutio...

InstallShield 2009: Remove a dll (being used by explorer.exe for context menu) during uninstall without any warning message

Install Shield Premier 2009: Basic MSI Project I have a dll that is supposed to be removed during uninstall. But this dll is being used by explorer.exe, it is used for generating windows explorer context menus with their icons(same as the menu items, icons we see when we right click on any file/folder and see the WinRAR items, icons). ...

MFC Dll with COM Interface

Hi All, I am pretty new to managed/unmanaged interoperability and COM concepts. I received a suggestion of using COM Interop, for using my existing MFC code in C#. But the problem for me is, i have a MFC Dll which is not a valid COM component. How to make this MFC DLLs to have COM-accessible interfaces ready for use in .NET. I tried t...

How to create dll using gcc compiler/Mingw for visual basic?

How to create dll using gcc compiler/Mingw for visual basic? ...

How do I combine an unmanaged dll and a managed assembly into one file?

SQLite from PHX Software has combined a managed assembly (System.Data.SQLite) with an unmanaged dll (the SQLite 32- or 64-bit dll) into one file, and managed to link them together. How do I do this? Do I need to embed the managed assembly into the unmanaged dll, or vice versa? ie. my questions are: In which order do I need to do this...

How do I use some specific dll in c/c++?

Like the msvcr70/msvcr80/msvcr90.dll, what's the code like to instruct the linker to link to one of them dynamically? Or has that anything to do with c/c++,but cmake? ...

Do an assembly have multiple namespaces or is composed of single namespace

Can an assemble have multiple namespaces or is composed of single namespace. ...

Include GAC Assemblies in Bin

Any ideas how to force a GAC DLL into referenced? Here is my issue, I constantly use a 3rd party DLL that registers itself into the GAC, and when I use it in my project, it reads it from the gac, and when I deploy, I'm always forgetting to add the DLLs since it is not located in the Bin/Referenced folder. Anyway to force Visual Studio ...

how do I make URI of dynamic web reference look in web.config instead of app.config?

I have a class library(DLL) which has a web reference, its dynamic. I have copied the setting into the applicationSettings of the web.config but still it keeps referring to the old URI I had set during develoment. any idea how i can make it take the URI of the web-service from the web.config? ...

FreeLibrary vs implicit unloading DLL

I have implemented a DLL including DllMain() entry function:- BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { case DLL_PROCESS_ATTACH: /* here im doing file memory mapped through CreateFileMapping() API and using it through MapViewOfFile() API storing some data struct...