Link to home
Start Free TrialLog in
Avatar of Ioannis Anifantakis
Ioannis AnifantakisFlag for Greece

asked on

Attach Visual Studio 2008 window in a Delphi window

Hello experts,

I have built a project regarding the greek election system in Delphi2009 (win32 development).
I received some components for our new tv graphics system written for .NET.

I must use Visual Studio 2008 to build the part that gives the video output.

------------

What I need to have is the following

Have a primary window in Delphi and have a space where I will attach the window of the .NET program written in C# and somehow have these two programms exchange data so my delphi dialog feeds with results data the .NET video program.

Therefore the VS2008 window must be PINNED at a fixed area and move together with the "master window" in delphi, as I show in my "wanna be" screenshot.

On top of that a hint of how these two windows could exchange data between them (like talk to each other - have the delphi window feed the election information to the video window and display the different stats depending on the different result).

Any suggestion will be valuable

--------------

PS. I give 290 Points because thats all I'm left with, I would gladly give 10 times more than this

vs2008-delphi.jpg
Avatar of Ioannis Anifantakis
Ioannis Anifantakis
Flag of Greece image

ASKER

To make it more simple, I want to define a "window container" in delphi where I will place the visual studio program window
Avatar of Emmanuel PASQUIER
Create an activeX component with delphi (or an activeForm), then add some properties and methods to it using the type library wizard, and from visual studio you put this on your main form as you would with any component or frame, and access those properties/methods with C# for the communication part
Oups, no that's the opposite you want. Whatever, that's the same technique, you have to create an activeX container from visual studio and import it in delphi to use it.
Hmmm.... can you give me a hand on this?

I opened VisualStudio2008, made a new project of type "Windows Forms Control Library".
That way I created a dll that contains a form.

Happy with this, I opened Delphi and went to "Component -> Import ActiveX Control".

Now when I try to attach the dll to delphi, I get the error "The OLE control does not support self-registration."
you have to manually register it
open a command line and type
regsvr32 C:\MyDllPath\MayDllName

then retry the import activeX (it now should be on the list of available interfaces)
regsvr32 does not apply to .NET
From some reading I've done RegAsm.exe replaces regsvr32.exe for .NET

So I found a sample project from the following address
http://www.codeguru.com/csharp/.net/net_general/comcom/article.php/c16257

You can follow the steps or simply download the code and the dll generated.  However, delphi cannot see it and continues to produce the error "The OLE control does not support self-registration."

Have you guys any idea about it?

Is it possible to produce ActiveX from CSharp and be able to register this as ActiveX to delphi?
Its driving me nuts!
For the very same dll if you try to regvr32 it, you get the error from regsvr32.exe:

CSharpWindowsActiveX.dll was loaded, but registration point DllRegisterServer was not found.

Awesome? lol
ASKER CERTIFIED SOLUTION
Avatar of Emmanuel PASQUIER
Emmanuel PASQUIER
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
epasquier:

Thank you for your fast reply.

I will look more into it and if within a couple of hours I haven't found anything I will give you the credits and open a new thread in C# section.

If you want to find my new post in that sections you can leave me your email my email address that I paste bellow so I can guide you to the next thread.

You can reach me at ioannisanif@gmail.com
However its worth to take a look into the adress I've pasted above and download the sample and see what happens yourself (inside the bin\release folder)
I don't have VS... but simply post here your other thread URL once you have opened the question , I'll follow that if I can
You don't need visual studio.  You only need .NET framework which I assume you have.


If you download the "demo", appart of the source, it has the compiled dll and the regasm.exe to register it at the folder I specified above