PDA

View Full Version : QAxWidget and C#



vxmontes
3rd August 2011, 15:52
Hi,

I'm trying to work with the QAxWidget. I'm very newbie, but I find out that is necessary to use the setControl method, and call the GUID of a dll.

At the Visual Studio, creating a Qt project, I can see a list of COM objects, but under Qt Creator I don't have that list.

What is that list, and how can I add a dll at that list of GUIDs acessible under Qt ?

Yet this way, I created a very simple dll in C#, with the code bellow



namespace dll_teste3
{
[Guid("E8EB6383-ABAC-448A-8E05-8CADDB3A5712")]
interface IMyDotNetInterface
{
int teste();
}

[ClassInterface(ClassInterfaceType.None)]
[Guid("A2E86BE9-0F94-43DF-B1C6-2FC3056DA028")]
class MyDotNetClass : IMyDotNetInterface
{
public MyDotNetClass()
{}
public int teste()
{
return 10;
}
}
}

How can I wrap a MyDotNetClass under Qt, and call the teste method ? I guess the QAxWidget is the right way.

Using a QLibrary is another way, but I can't access the class or methods.

Excuse my extensive question, but I don't found a nice doc about the first steps of QAxWidget use.

If anyone can answer the example would be a very nice first step.

Thanks in advance,
Vitor