Sight problem with TDBAccess.dll in C#

This forum contains all information about TDBAccess library for NHL 2004 roster access and general NHL coding questions.

Moderator: Owen

Post Reply
ou8her2

Sight problem with TDBAccess.dll in C#

Post by ou8her2 » Sat Feb 19, 2005 2:39 am

using your dll in C#.Net 2003 the TDBTableGetProperties method does not return a valid name. However in VB .Net 2003 it does return a valid name. I can't figure out why. :? Maybe you could shine some light on this :idea: .


TY

Also the dll isn't recognized as a valid dll or assembly when I try to reference it in my projects. They only way I can use it is to use the DLLImport and the LIB attributes.

ou8her2

Err slight -> not sight...

Post by ou8her2 » Sat Feb 19, 2005 11:57 am

sorry guess I was a bit tired. :?

Artem
Site Admin
Posts: 1166
Joined: Thu Oct 23, 2003 5:30 pm

Post by Artem » Sat Feb 19, 2005 8:44 pm

This dll is not a .NET assembly, so it's only natural that you can only use DLLImport to get to the functions.

I'm not a big specialist in C#, but my guess would be that you don't declare TdbTableProperties structure correctly. If I were to write it in C, I would do this:

Code: Select all

struct TdbTableProperties {
  char* name;
  int fieldCount;
  int capacity;
  int recordCount;
  int deletedCount;
  int nextDeletedRecord;
}

...
void myProc() {
  TdbTableProperties tableProps;
  tableProps.name = malloc(5);
  TDBTableGetProperties(0, 0, &tableProps);
  ...
  free(tableProps.name);
}
But this is an 'old way' of programming so to speak. There is no malloc in .NET.

ou8her2

I've got it

Post by ou8her2 » Sat Feb 19, 2005 11:41 pm

Thank you for replying. I simply wrote a wrapper in VB around your dll. I used a C# form to show a datagrid of all the tables and values. My program looks very similar to your TDBView.exe except I can now write back the data to the 'ros' file either one row at a time, the full table or the whole file at once. Saving the whole file takes quite a bit of time though.

Also I stuck all of the data into a .Net DataSet class. This way I can now Import and Export, xls, csv, xml and straight to and from an SQL database. (Not fully finished yet) :?

I believe I have the first Madden NFL 'ros' editor on my hands :o . Other than the work you've done. I'm not sure why you haven't posted an editor. The TDBAccess.dll is amazing work. I'd like to know how you did that. Your dll made it so easy to create an editor.

Artem
Site Admin
Posts: 1166
Joined: Thu Oct 23, 2003 5:30 pm

Post by Artem » Sun Feb 20, 2005 2:03 am

I have an editor, just not for Madden :) I'm not a big fan of american football and I don't have the game.

But I'm sure there got to be a way to import these things in C# without wrapping in in VB first.

Post Reply