Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dialer??
Message
From
05/11/2008 10:53:24
 
 
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01359668
Message ID:
01359859
Views:
28
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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform