View previous topic :: View next topic |
Author |
Message |
m.burkhardt
Joined: 02 Sep 2008 Posts: 26
|
Posted: Wed Sep 24, 2008 12:30 pm Post subject: Jump into C# Constructor from within Fortran |
|
|
I have a question about the OBJECT Method in Fortran.
When I use an external Assembly and create an object like
in the following code (myBlsDbLibrary)
Code: |
OBJECT("BLSDBLibrary.BlsDb") myBlsDbLibrary
ASSEMBLY_EXTERNAL(name="BLSDBLibrary.BlsDb.GetData") :: blsdbgetdata
OBJECT("System.String") strSQL
strSQL=NEW@("System.String", "SCHMELZNR")
! myBlsDbLibrary = new@("BLSDBLibrary.BlsDb")
arraylist=blsdbgetdata(blsdblibrary, strSQL)
|
I don't jump into the c# constructor!
When I debug this code I also doesn't jump into the constructor of the Class BlsDb.
Why do I not jump into the contructor?? In this Constructor I connect a Database!
When I'm trying to create an object myBlsDbLibrary with the following code:
Code: | OBJECT("BLSDBLibrary.BlsDb") myBlsDbLibrary
myBlsDbLibrary=new@("BLSDBLibrary.BldDb")
|
I get a compiler error like this:
" There were compile errors, abandoning link..."
Can somebody help me to jump in my c# Constructor?
Greeting from Germany |
|
Back to top |
|
 |
Andrew
Joined: 09 Sep 2004 Posts: 232 Location: Frankfurt, Germany
|
Posted: Wed Sep 24, 2008 9:55 pm Post subject: |
|
|
The object is only created when you call NEW@ and this is the point where the constructor will be called. If you single step using F11, the debugger will enter the constructor.
However, you post is a little confusing - it seems like you are not able to compile the code? Can you post more details of the error message you are seeing please?
Some things you could check are:
- have you added a reference to the C# library within the Fortran project?
- have you used the fully qualified name of the class?
- if your constructor requires any arguments, have you specified them after the name of the class in the call to NEW@? |
|
Back to top |
|
 |
m.burkhardt
Joined: 02 Sep 2008 Posts: 26
|
Posted: Thu Sep 25, 2008 5:15 am Post subject: |
|
|
That is correct: I can't compile the code. The errormessage is:
" There were compile errors, abandoning link..."
nothing more!
To your questions:
have you added a reference... : YES
have you use the qualified name...: YES Like this: "Namespace.ClassName" I see it within my Intellisense
if your constructor requires any...: YES I tried two versions: with Argument and without arguments.
Code: | blsdblibrary=NEW@("BLSDBLibrary.BlsDb", "String")
AND
blsdblibrary=NEW@("BLSDBLibrary.BlsDb")
|
Every time I get the same Error Message showen above!
I use the same Library in an C# Project without any problems!
Here's the constructor of the C# Library
Code: | namespace BLSDBLibrary
{
public class BlsDb
{
public BlsDb()
{
// Connect to Database
}
public BlsDb(String strUser)
{
// Connect to Database
}
....
}
}
|
Greetings |
|
Back to top |
|
 |
Andrew
Joined: 09 Sep 2004 Posts: 232 Location: Frankfurt, Germany
|
Posted: Thu Sep 25, 2008 9:48 am Post subject: |
|
|
Could you please post your Fortran code as it is very hard to tell what might be causing the problem from the information so far? Thanks. |
|
Back to top |
|
 |
|