Welcome! Log In Create A New Profile

Advanced

Using a WinDev assembly from a .NET app

Posted by Gus 
Gus
Using a WinDev assembly from a .NET app
April 17, 2009 08:07PM
Hi:
Did someone create a .NET assembly in WinDev and called it from a .NET app? I tried this, but the .NET app throws an exception because it says that DW120NET2.DLL (which is provided by WinDev for .NET interop) contains unmanaged code.
Does someone have experience with this? Any example to see?

Thanks;
Gus
BLS
Re: Using a WinDev assembly from a .NET app
April 17, 2009 08:21PM
Hi Gus,
I have done it using Visual C# 2005 and WD 11. I wrote an introduction a few month ago. (Here on MySnip) ...

Regarding your error : which :NET framework(s) are installed on your machine ?
Björn
BLS
Re: Using a WinDev assembly from a .NET app
April 17, 2009 08:25PM
okeedokee, quite trivial but nevertheless here it is :

[forum.mysnip.de]

HTH Björn
Gus
Re: Using a WinDev assembly from a .NET app
April 17, 2009 11:10PM
Hi Bjorn:
I 'm using VS2008 and I have installed Framework 1, 2, 3 and 3.5 (all flavors!)

Gus
BLS
Re: Using a WinDev assembly from a .NET app
April 18, 2009 08:49AM
Hi Gus,
I''ll re-create my WD assembly using WD12 and recompile the C# stuff in VC # 2008 this weekend. I'll keep you informed. Sorry that's all I can do atm.
Björn
Gus
Re: Using a WinDev assembly from a .NET app
April 18, 2009 08:27PM
Hi Bjorn:
Thanks for that.
In my case, I created a class which has a method. This method opens a simple window.
When the code initialize the class:

WL.CClass1 w = new WL.CClass1();

I get the folowing error:
TypeInitializationException was unhandled.
The type initializer for 'WL.CClass1' threw an exception.

Right now, I'm testing this on a Windows application. But my idea is to generate an assembly which can be called from SQL Server as a STORE PROCEDURE (and then it can be used in triggers) so I can use HFile syntax rather than C# .

Thanks;
Gus
BLS
Re: Using a WinDev assembly from a .NET app
April 18, 2009 09:43PM
Hi Gus,
Quote
Gus
Hi Bjorn:

Right now, I'm testing this on a Windows application. But my idea is to generate an assembly which can be called from SQL Server as a STORE PROCEDURE (and then it can be used in triggers) so I can use HFile syntax rather than C# .

Gus

Means you want to call :
1) A WINDEV assembly from a MS SQL server stored procedure ?
Doable.

2) (and then it can be used in triggers )
What is IT .... and what part of code you are talking about ?
You can not define/start a trigger from within a stored procedure (afaik)

2 a)... so I can use HFile syntax rather than C#

IF you want to use the HFxxx Syntax from, for instance, C# or any other DOT NET language , you can simply create a wrapper class in WINDEV which encapsulates these calls. ( There are other options, though)

Note : In case that want to use a WD class from C# et. al :
A method like this one is not acceptable. RUNTIME Error
FUNCTION Mutation( nMutation )
So :WINDEV Duck Typing is not usable from any other DOT NET language
Instead :
FUNCTION Mutation(nMuitation is int )  // or better :  Mutation(LOCAL nMuitation is int )
is what you need.
Following this guidelines using a WD class from any other DOT NET language is straight forward and works pretty fine.

If you like ? I am willing to help you as much as can...just let me know.
Björn
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: