Hello All, Could someone please direct me on how to go about importing a C header file into VB Net or maybe converting an .h file into .bas? Thanx alot Guys.

Thanx for your reply John. That solution worked out splendidly! Unfortunately the function that I am using does not allow me to send data directly to the modem but I followed your suggestion and imported the mscommlib. I was then able to send data directly to the com port using mscomm. Thanx alot for your help.

Jr, got to thinking about this after I posted and you may need to send
AT+++ to the modem first to get it to ‘wake up’ and listen for commands
then a short pause (few milliseconds) and then ATH0. This would just be a
string you would pass to the function you use to send your data to the
remote location.

Function SendData(ByVal TheData as String) As Boolean

The call would be like
If SendData(“hello remote receiver this is my data”) then

If SendData(“AT+++”) then
If SendData(“ATH0”) then

John Warner

Just ATH0 to the modem, that will cause it to go On Hook, ATH1 will take
it off hook. This would just be inserted into your data stream. You might
need a slight pause between AT and H0.

John Warner

From: jr_woodside via vb-dotnet-l
[mailto:vb-dotnet-l@Groups.ITtoolbox.com]
Sent: Monday, July 07, 2008 4:57 PM
To: John Warner
Subject: RE:[vb-dotnet-l] Importing C header files into VB Net

I’m sorry the code is in VC++. I’m working on an application that does
some data transfer over a telephone line. Where I run into a problem is
trying to hang up the modem on request. I’ve scoured the web for a direct
way to do this with little success. However I found some code in a VC++
header file that I want to include in my VB Net app and see how it works.

I’m sorry the code is in VC++. I’m working on an application that does some data transfer over a telephone line. Where I run into a problem is trying to hang up the modem on request. I’ve scoured the web for a direct way to do this with little success. However I found some code in a VC++ header file that I want to include in my VB Net app and see how it works.

Can’t offer help on the conversion, but I’m pretty sure the .NET compiler
for VB and or C# won’t work with C header files. Now Visual C++ would of
course be a different story.

John Warner