Whiteclouds 9-Sep-10 22:52 9-Sep-10 22:52 Hi, everyone! Now I am developing an application using TAPI. I want to import some functions from cellcore.dll. But I don't know how to write the prototype of these functions.
Hello Windows CE is an OS that is built according to the settings an OEM decides. An OEM can include or exclude MS offered parts with the OS image they built.
The functions I want to import are: lineInitializeEx, lineNegotiateAPIVersion, lineOpen, lineSetEquipmentState, lineGetEquipmentState, lineRegister, lineClose and lineShutdown. For example, I try to import lineInitializeEx with the code below: [DllImport( ' cellcore.dll')] private static extern long lineInitializeEx( ref uint phLineApp, IntPtr hInstance, IntPtr CallBackFunc, string strAppName, ref uint dwDevNum, ref uint pdwApiVersion, ref LINEINITIALIZEEXPARAMS lineParams); I had declare LINEINITIALIZEEXPARAMS struct previous. It can compiled.
But can't be executed. The error message say it can't find the entry point for this function. I wonder the prototype is wrong.
How to write it? I am pleasure to see your answer. But I have still a problem. As the code you show, the struct LINEINITIALIZEEXPARAMS has two elements: hEvent and hCompletionPort. But in C++, this struct has a union.
The element in it have the same name as your code. I know the keyword 'union' isn't exist in C#.
But I think this struct shouldn't be declare as this. Additional, I can't still execute this program. The error is still 'No entry point found for lineInitializeEx'. I hope you can help me again.
Www .buku menejemen bab2f kasmir. PENGANTAR MANAJEMEN KEUANGAN – Kasmir Kategori: Manajemen| 588 Kali Dilihat PENGANTAR MANAJEMEN KEUANGAN – Kasmir Reviewed by adminrahma on Kamis, Februari 23rd, 2017. This Is Article About PENGANTAR MANAJEMEN KEUANGAN – Kasmir.
MSDN says: ' Instance handle of the client application or DLL. The application or DLL can pass NULL for this parameter, in which case TAPI uses the module handle of the root executable of the process (for purposes of identifying call handoff targets and media mode priorities). The clue is ' can pass NULL', which in the case of PInvoke handles is IntPtr.Zero. That should work. If not, have a look at the [] property - perhaps this will work? IntPtr hInstance = System.Diagnostics.Process.GetCurrentProcess().Handle; and pass hInstance as the parameter., I prefer IntPtr.Zero though! I had tested the code above.
I feel sorry that it can't work. Because I am developing application for Windows Mobile. The property System.Diagnostics.Process.GetCurrentProcess().Handle can't be get in Mobile. I had try to give hInstance with the value of new IntPtr(GetModuleHandle(new IntPtr(0)).ToInt32()).
But when I call lineInitializeEx with it, the return value is an error code. That tell me the value of handle is invalid(0x80000035). Base of all, I think I can't call lineInitializeEx with C# at all. Have you tried with IntPtr.Zero or new IntPtr(0) What is the error code?
It should be one of these: /// /// No error. /// public const uint LINEERR_NOERROR = 0x00000000; /// /// Invalid application name. /// public const uint LINEERR_INVALAPPNAME = 0x80000015; /// /// The INI file is corrupted.
/// public const uint LINEERR_INIFILECORRUPT = 0x8000000E; /// /// Invalid parameter. /// public const uint LINEERR_INVALPARAM = 0x80000032; /// /// Invalid pointer. /// public const uint LINEERR_INVALPOINTER = 0x80000035; /// /// No memory available. /// public const uint LINEERR_NOMEM = 0x80000044; /// /// The operation failed. /// public const uint LINEERR_OPERATIONFAILED = 0x80000048; /// /// The application attempted to initialize TAPI twice. /// public const uint LINEERR_REINIT = 0x80000052; If the version of WinMob you're targetting supports TAPI then it will work once you get it just right! Maybe post your lineInitializeEx and LINEINITIALIZEEXPARAMS.