Making a C# kill event for a vb6 app?

Here is a pretty standard scheme for asynchronous background processing with VB6 clients and VB6 servers. (For instance it’s in Dan Appleman’s book and Microsoft’s VB6 samples.) I think it should work for a C# client too. The VB6 ActiveX EXE object should expose an event CheckQuitDoStuff(). This takes a ByRef Boolean called Quit. The … Read more

Hosting the .NET runtime in a Delphi Program

In the Jedi Code Library (JCL) – free – there is a JclDotNet.pas, containing a class TJclClrHost, probably doing what you want: TJclClrHost = class(TJclClrBase, ICorRuntimeHost) private FDefaultInterface: ICorRuntimeHost; FAppDomains: TObjectList; procedure EnumAppDomains; function GetAppDomain(const Idx: Integer): TJclClrAppDomain; function GetAppDomainCount: Integer; function GetDefaultAppDomain: IJclClrAppDomain; function GetCurrentAppDomain: IJclClrAppDomain; protected function AddAppDomain(const AppDomain: TJclClrAppDomain): Integer; function RemoveAppDomain(const … Read more

Interoperating between Matlab and C#

Beginning with the R2009a release of MATLAB, .NET objects can be accessed from MATLAB: http://www.mathworks.com/help/techdoc/matlab_external/brpb5k6.html In older versions of MATLAB, it is possible to access .NET objects from MATLAB using CCW: http://www.mathworks.com/support/solutions/data/1-5U8HND.html?solution=1-5U8HND and the MATLAB engine from .NET: http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_external/f135590.html#f135616 You can also use the MATLAB Builder NE to wrap m-code into .NET assemblies. http://www.mathworks.com/products/netbuilder/

Jython and python modules

You embed jython and you will use some Python-Modules somewere: if you want to set the path (sys.path) in your Java-Code : public void init() { interp = new PythonInterpreter(null, new PySystemState()); PySystemState sys = Py.getSystemState(); sys.path.append(new PyString(rootPath)); sys.path.append(new PyString(modulesDir)); } Py is in org.python.core. rootPath and modulesDir is where YOU want ! let rootPath … Read more

keybd_event along with PostMessage win32 not working when Visual Studio has focus (or any application run as admin)

These are the VK_MEDIA_NEXT_TRACK and VK_MEDIA_PREV_TRACK virtual keys. The processing for them is highly convoluted: Whatever program owns the foreground window will retrieve his keystroke from its message queue when it calls GetMessage() The TranslateMessage() call in that program’s message loop translates the keystroke to a WM_APPCOMMAND message, APPCOMMAND_MEDIA_NEXTTRACK or APPCOMMAND_MEDIA_PREVIOUSTRACK and sends it to … Read more

Windows Forms window changes its size when I create a WPF window

You discovered that WPF calls SetProcessDPIAware(). It happens inside the module initializer for PresentationCore. Which is formally illegal, it must always be called before an app creates any windows or load DLLs that might cache the DPI value. Or in other words, lots of ways that this can go wrong, you only discovered the mild … Read more