PDA

Click to See Complete Forum and Search --> : Bad DLL calling convention ???


David Laplante
May 5th, 2000, 07:19 AM
I am trying to use the icq api but am getting this error message when I try to use one of the function.

The function set wich of MY functions (In my app) will be called when a certain notification from ICQ arrives...

here goes..
Now the documentation for the ICQ API is written for C++, I have managed to convert most of them but maybe this one is not converted correctly ?

What the documentation says:

void WINAPI ICQAPIUtil_SetUserNotificationFunc(UINT uNotificationCode, void *pUserFunc);


In a module:

Public Declare Function ICQSetUserNotificationFunc Lib "ICQMAPI.dll" Alias "ICQAPIUtil_SetUserNotificationFunc" (uNotificationCode As Integer, ByVal pUserFunc As Variant)



In the code of a form:

Call ICQSetUserNotificationFunc(1, AddressOf ICQOnlineListChange)


Is the function converted correctly ? if it is, what is the problem. If not , How should it be?

David Laplante
May 7th, 2000, 11:50 PM
Thank You Stevie-O!

I AM new at this and did not know of those rules... I will make sure I obey them at all times (I don't want to lose everything on my computer because of VB)

if you have other rules, I would like to know them!
thanks again

Stevie-O
May 8th, 2000, 12:39 AM
Hehe, will do =)

Consider yourself lucky - to my knowledge, none of those rules are actually explicitly written down anywhere. I determined them based on some existing documentation and a great deal of trial and error. VB's universal message 'Invalid DLL calling convention' wasn't much of a help either :P It reminds me of the good old DOS days when there was only one printer error - error #27, "Out Of Paper". QuickBASIC would say 'out of paper' whether the printer was off, unplugged, or even actually out of paper.