replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Jump into C# Constructor from within Fortran
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Jump into C# Constructor from within Fortran

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
m.burkhardt



Joined: 02 Sep 2008
Posts: 26

PostPosted: Wed Sep 24, 2008 12:30 pm    Post subject: Jump into C# Constructor from within Fortran Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Wed Sep 24, 2008 9:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
m.burkhardt



Joined: 02 Sep 2008
Posts: 26

PostPosted: Thu Sep 25, 2008 5:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Thu Sep 25, 2008 9:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group