DLL access

agiltinan

New member
Joined
Jun 27, 2007
Messages
4
Programming Experience
3-5
Hi all,
I am trying to access a DLL but am puzzled about how to access the functions within the DLL.
I am able to access DLL's in general using

Declare Function ... Lib ...(ByRef Var1, ...) as Int.

But i'm not sure how to access this particular DLL's functions due to the following:
a typical function within this DLL would be

int ffdopn( file **fptr, char *filename, int mode, int *status)


The problem is i'm not sure how to access the double pointer **fptr or if its even possible within VB.NET as i know pointers in general are not used within VB.NET

Thanks for the help,
agiltinan
 
Have you tried adding it as a reference to the .NET project. Then you can view the objects within it. If you make an instance of the object within that DLL you will then be able to access its methods and properties.
 
I stand corrected about the function pointers.

I have tried to add the DLL as a reference but this DLL was built in C and was not intended to be used as a COM component/ActiveX Object in anyway. Hence, i get the error saying
'Make sure it is a valid assembly or COM'
 
Hmmm...You might be out of luck but something tells me that there is a way to add this DLL somehow. Click around some of this stuff you may have to register the component using the SDK. I do not think that the link im sending you will do it but there is a tool similar to the one in the link that may allow you to register that component. Here is the link:

http://msdn2.microsoft.com/en-us/library/tzat5yw6(VS.71).aspx

I apologize in advance if I sent you on a wild goose chase.
 
thanks ss7thirty.
I've tried everything from regsvr32 to gacutil but nothing. It seems this DLL just wasn't meant to be used VB.NET. (at least not easily anyway :) ).

Ill just have to re-write the functions from scratch myself. thanks again
 
regsvr32 is not the same as regasm in the .NET SDK there is another tool similar to regasm. Regasm, i believe, it to register .NET components with COM but there is anoterh tool, I cannot find the name for some reason that does the opposite and it may work for the DLL you have. Maybe someone else could help me out with the name of the other tool.
 
It would be great if i could get the dll registered and functioning through .NET but i believe i've exhausted most avenue's (including all import options in the tools kit).
Thanks again
 
Back
Top