interop

Can I write my apps in python and then run them from C?

I need to write a client-server application. I want to write it in python, because I'm familiar with it, but I would like to know if the python code can be ran from C. I'm planning to have two C projects, one containing the server code, and one containing the client code. Is it possible to eval the python code and run it ? Is there anot...

How to avoid building a walled garden?

Some friends and I have had an idea for a website and have started working on it. It will rely on people contributing to a shared knowledgebase, and people will also be able to create personal profiles with reasonable amounts of data. We intend people should be able to leverage their content on other sites (e.g.: flickr, youtube) when bu...

How do I get results from Matlab in Java?

I can call a .m file in Matlab from Java and that works fine, but I want to retrieve the results from Matlab and display them in Java. How can I do this? ...

Hosting CLR versus using ClrCreateManagedInstance - what are the benefits?

I have successfully implemented interop beftween Win32 application and managed .Net dll as described here. But I also read here that it is possible to host the entire CLR inside of the unmanaged process. So my question is: why would you do that? It is somewhat more complex than just use an object - what benefits you gain for this price ...

Are there any reasons not to host a COM server in a COM+ application?

The simplest way to transform an in-proc COM server into an out-proc COM server is creating a COM+ application. What are the possible drawbacks of doing it this way? ...

What's the purpose of noncreatable coclasses in IDL?

What is the reason for declaring noncreatable coclasses like the following in IDL? [ uuid(uuidhere), noncreatable ] coclass CoClass { [default] interface ICoClass; }; I mean such class will not be registered to COM anyway. What's the reason to mention it in the IDL file and in the type library produced by compiling that ID...

Reentrancy was detected

I'm getting "Reentrancy was detected" MDA error while setting a webbrowser control's properties. This only happens if I call "SetWindowsHookEx" to hook some dials within the same thread. Normally this hooking code works fine but it doesn't play nice with Webbrowser Control. When I ignore the exception code works fine, at least look like...

Set System Time Zone from .NET

Does anyone have some code that will take a TimeZoneInfo field from .NET and execute the interop code to set the system time zone via SetTimeZoneInformation? I realize that it's basically mapping the TimeZoneInfo members to the struct members, but it does not appear obvious to me how the fields will map exactly or what I should care abou...

Java SSL renegotiation (from SSL to clear channel)

I'm doing something in Java SE that would require me to use SSL in an unusual way. The required steps would be something like: Establish an SSL session; Exchange some private information; Renegotiate connection parameters to stop using cryptographic operations. I haven't found in the Java API a way to to this. I believe that the prob...

Using ,NET Generic List ToArray in a COM Called Wrapper causes access violation, am I missing something?

I'm having a problem when trying to pass an array back to a COM caller. Basically, I have a generic List of classes, that I want to return to the COM caller, you can't use generics in COM, so it's got to be strongly typed. I figured just returning a .ToArray() on the List would give me what I need. When I use it in VB6, it works perfe...

Usage of generated Actionscript proxy enum from C#

Sorry if the title is unclear - not sure how to phrase it. Feel free to edit it. I have a web service written in C# and it uses an enum. When I am consuming this webservice with Flash, I had Flex generate the proxy classes - which also generates said enum in Actionscript. My problem is that I don't know how to use this generated Actions...

What's the difference between CoCreateInstance() and CoGetClassObject() when creating objects on the same machine?

I understand that CoCreateInstance finds the COM server for the given class id, creates the object instance for that id and retrieves an interface from that object instance. CoGetClassObject() finds the COM server for the class id, creates an instance of the class factory for that class id and retrieves that class factory interface which...

VB.Net constructor order matters?

Why does constructor ORDER matter in VB.Net? I am building a .Net type library which is meant to wrap an underlying COM library completely so that the consumers of the API can pretend to use a nice .Net library with .Net collections and whatnot instead of a COM library. Currently most of my classes are just 1 to 1 wrappers built using R...

interoperation between mercurial and subversion

A similar question has been asked recently, but is not the same. The Mercurial website has a detailed page listing comparisons for 4 different options for getting Mercurial and Subversion to interoperate. I am wondering if anyone out there has tried one or more of these, and could relate any really good or really bad experiences. The n...

When and why use CoLoadLibrary?

The description of CoLoadLibrary() says it does pretty much the same as LoadLibraryEx() - loads a DLL into the process. COM classes creation functions - CoCreateInstance() and CoGetClassObject() - both do load the necessary DLL into the process too. Then why is CoLoadLibrary() needed in the first place and how should it be used? ...

Where is using null BSTR documented?

It's at least common practice to treat null BSTR (null WCHAR* pointer) as an empty string and design all the code manipulating BSTRs accordingly. Answers to this question say the same. Where is this practice documented? Is there any official document describing this convention? ...

Passing pointers from unmanaged code

Hi, I have a C# project that imports a C dll, the dll has this function: int primary_read_serial(int handle, int *return_code, int *serial, int length); I want to get access to the serial parameter. I've actually got it to return one character of the serial parameter, but I'm not really sure what I'm doing and would like to understan...

WPF TextBox not accepting Input when in ElementHost in Window Forms

We are developing a UI Control in WPF to be consumed within an existing Windows Forms / MFC application engine (Rhino 3D). The application engine exposes the ability create a "Dockbar" which essentially lets you put Windows Forms controls inside a child window which can dock to the Engines Interface. I am attempting to put a simple WPF...

Interop problem- - Different C# structure for different OS Architecture

I have a C++ structure, and I have to interop it from my C# code. I compile my C# code as a platform agnostic dll, which means that I can use the same C# dll on different platforms ( 32bit or 64bit-- doesn't matter), whereas I distribute the C++ differently for different platforms. The problem is that the C++ structure that I must int...

.NET interop in PowerBuilder

I'm looking for a way to do two-way communication between a PB object and a .NET (C#) object. In looking at Brad's .NET version of his GUI controls, I see how to give the .NET object a reference to the PB object. But in that example, it's cast as a PowerObject (basically). That C# code only calls TriggerEvent() on the PB object. I want ...