Versions des environnements
Network:
Windows 2008 Server
Can you give me an example..or an artcle I could read to understand this other approach? Thanks!!!
bob
>Hi,
>
>Is it possible that an error is occurring in the DLL but that it is not raising an exception?
>
>Is this a COM DLL - if so have you tried adding it as a reference and using Interop instead?
>
>
>>In the original FoxPro the code is as follows:
>>
>>DECLARE INTEGER Dial IN ("autodial.dll") ;
>> INTEGER nPortNum, STRING cdial
>>...
>>
>>m.nError = Dial(m.nHandle,m.cModemString)
>>
>>It works great. In C# I rewrote the code like this:
>>
>>
>>public class AutoDial
>>{
>>[DllImport("AutoDial.dll")]
>>public static extern int Dial(int nPort, string DialString);
>>}
>>public class Dialer
>>{
>>public static void Dial(string DialString, int nPort)
>>{
>>try
>>{
>>int nError = AutoDial.Dial(nHandle, DialString);
>>}
>>catch (Exception ex)
>>{
>>MessageBox.Show(ex.Message, "Auto Dial Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
>>}
>>}
>>
>>I get no errors, but it doesn't work. So I just assumed that C# couldn't talk to the DLL like FoxPro could. I contracted with someone in 1998 to create the DLL. Am I missing something obvious?
>>
>>Bob
>>
>>>>I am converting a VFP program to C#. In the VFP program I had an autodialer that would dial the phone then prompt the user to pickup the headset and then click the mouse to hang up the phone. The original dialer was written in C and worked with a DLL and a DECLARE statement in Foxpro.
>>>>
>>>>I can't get this (OLD) DLL to work with C# so I was wondering if anyone has attempted this in C# using .NET.
>>>
>>>So how and what have you done to try to get it to work?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement