codemorphis.com Forum Index codemorphis.com
Software development: pure and simple.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Calling a DLL

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    codemorphis.com Forum Index -> Visual Programming Forum
View previous topic :: View next topic  
Author Message
CodeMorphis



Joined: 02 Dec 2003
Posts: 252

PostPosted: Tue May 31, 2005 2:09 pm    Post subject: Reply with quote

That function prototype is correct, following the VB equivalent that you provided.

You would then set the DLL path C:\WINDOWS\SYSTEM32\Cards.Dll in input data port 0 of the DFF Func Call component. You would also specify the name of the function, which appears to be "cdtInit" in input data port 1.

Note that you have to specify the return type of long in the component's "Function return type" property.

If you are doing this and it is not working, can you provide more details? Is there any error message that appears?

Also, are you able to call this DLL function from VB or elsewhere?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeMorphis



Joined: 02 Dec 2003
Posts: 252

PostPosted: Mon Jun 06, 2005 11:18 am    Post subject: Reply with quote

Apparently, the correct prototype is:

BOOL WINAPI cdtInit (int *width, int *height)

When tested with this prototype it seems to go through and return valid values, however, it still seems to be flagged as an exception being caught.
We are investigating this and will report back.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeMorphis



Joined: 02 Dec 2003
Posts: 252

PostPosted: Tue Jun 07, 2005 1:21 pm    Post subject: Reply with quote

Yes, long_ptr is not the correct argument type to send. It should be int_ptr. When we look at this DLL function, we see that the function call actually goes through and returns the correct values. It also returns a success code through the return value output data port (value of 1, which is a true boolean value). So everything seems to work, however, upon returning from the DLL function call cdtInit then raises the following exception:

Object reference not set to an instance of an object.

We are trying to find out why this happens.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeMorphis



Joined: 02 Dec 2003
Posts: 252

PostPosted: Fri Jun 10, 2005 4:50 pm    Post subject: Reply with quote

A change to handle this exception has been added, which will be included in either the next update or the next major release.

Thanks for reporting this.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeMorphis



Joined: 02 Dec 2003
Posts: 252

PostPosted: Tue Jul 19, 2005 9:55 pm    Post subject: Reply with quote

This should be addressed by update 1.1.9
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    codemorphis.com Forum Index -> Visual Programming Forum All times are GMT - 5 Hours
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