FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

rasapi32.lib

 
Post new topic   Reply to topic     Forum Index -> Bindings
View previous topic :: View next topic  
Author Message
JetBird



Joined: 15 Aug 2007
Posts: 12

PostPosted: Fri Feb 13, 2009 9:08 am    Post subject: rasapi32.lib Reply with quote

hello

where can I get 'rasapi32.lib' ?
Back to top
View user's profile Send private message
JetBird



Joined: 15 Aug 2007
Posts: 12

PostPosted: Mon Feb 16, 2009 9:09 am    Post subject: Reply with quote

I've used 'implib' utility from basic digital mars utils pack:

Code:

implib /s rasapi32.lib c:\windows\system32\rasapi32.dll


but still can't link (rasapi32.lib is located in the dmd/lib directory):

Code:

E:\workspace\d\ras_test>make
dmd win32.lib rasapi32.lib rastest.obj -ofrastest
OPTLINK (R) for Win32  Release 8.00.1
Copyright (C) Digital Mars 1989-2004  All rights reserved.
rastest.obj(rastest)
 Error 42: Symbol Undefined _D5win323ras19RasEnumConnectionsAFPS5win323ras8RASCO
NNAPkPkZk
--- errorlevel 1
Back to top
View user's profile Send private message
eldar



Joined: 14 Jun 2008
Posts: 101
Location: Ufa, Russia

PostPosted: Mon Feb 16, 2009 9:59 am    Post subject: Reply with quote

I think there is no symbol in that dll with this name: _D5win323ras19RasEnumConnectionsAFPS5win323ras8RASCO
It is a C library, isn't it?
Back to top
View user's profile Send private message
JetBird



Joined: 15 Aug 2007
Posts: 12

PostPosted: Thu Apr 09, 2009 6:24 am    Post subject: Reply with quote

Hello!

I have a question about using bindings/win32, RAS.

I've
1. compiled win32.lib,
2. used "implib rasapi32.lib rasapi32.def" with written by hand rasapi32.def with following content (linkdef (don't know why) can't find any of that symbols):

Code:
LIBRARY RASAPI32
DESCRIPTION 'rasapi32.dll'
EXETYPE NT

EXPORTS
_D5win323ras20RasGetConnectStatusAFT5win323ras8HRASCONNPS5win323ras14RASCONNSTATUSAZk = RasGetConnectStatusA
_D5win323ras18RasGetErrorStringAFkPakZk = RasGetErrorStringA
_D5win323ras15RasEnumEntriesAFPaPaPS5win323ras13RASENTRYNAMEAPkPkZk = RasEnumEntriesA


3. compiled the following code:

Code:
PhoneBookEntries getPhoneBookEntries() {
    auto entries = new PhoneBookEntries;

    RASENTRYNAME[100] buf;
    buf.ptr.dwSize = RASENTRYNAME.sizeof;
    uint entriesNum, length = buf.length*RASENTRYNAME.sizeof;

// THIS IS IMPORTANT err VARIABLE
    auto err = RasEnumEntries(null, null, buf.ptr, &length, &entriesNum);
   
// ....

    return entries;
}


with cmd:
Code:

dmd -c -ofmain.obj main.d
dmd -c -ofrasdial.obj rasdial.d
dmd main.obj rasdial.obj -ofdialer rasapi32.lib win32.lib


4. and always get 'err' variable equal to 632, "ERROR_INVALID_STRUCTURE" (see http://msdn.microsoft.com/en-us/library/aa377380(VS.85).aspx for RasEnumEntries function details),

BUT the analogous DELPHI code works perfectly:

Code:
procedure getPhoneBookEntries(list: TStrings);
var
  BuffSize          : Integer;
  Entries           : Integer;
  Entry             : Array[1..MaxEntries] of TRasEntryName;
  X,Result_         : Integer;
begin
  list.Clear;
  Entry[1].dwSize:=SizeOf(TRasEntryName);
  BuffSize:=SizeOf(TRasEntryName)*MaxEntries;
  Result_:=RasEnumEntries(nil, nil, @Entry[1], BuffSize, Entries);

...

There is something I do wrong here... but what?
Back to top
View user's profile Send private message
smjg



Joined: 29 Sep 2004
Posts: 41

PostPosted: Fri Apr 10, 2009 10:58 am    Post subject: Reply with quote

JetBird wrote:
I've used 'implib' utility from basic digital mars utils pack:

Code:

implib /s rasapi32.lib c:\windows\system32\rasapi32.dll


but still can't link (rasapi32.lib is located in the dmd/lib directory):

Code:

E:\workspace\d\ras_test>make
dmd win32.lib rasapi32.lib rastest.obj -ofrastest
OPTLINK (R) for Win32  Release 8.00.1
Copyright (C) Digital Mars 1989-2004  All rights reserved.
rastest.obj(rastest)
 Error 42: Symbol Undefined _D5win323ras19RasEnumConnectionsAFPS5win323ras8RASCO
NNAPkPkZk
--- errorlevel 1


There's a missing extern (C) in ras.d. (I don't know why this is extern (C), not extern (Windows) like the rest, but the former is what linked when I tried it.)
Back to top
View user's profile Send private message
smjg



Joined: 29 Sep 2004
Posts: 41

PostPosted: Fri Apr 10, 2009 11:26 am    Post subject: Conversation moved Reply with quote

This discussion has been continued on the digitalmars.D newsgroup.
Back to top
View user's profile Send private message
onlinejack



Joined: 29 Mar 2010
Posts: 1

PostPosted: Mon Mar 29, 2010 5:37 pm    Post subject: Reply with quote

RasGetConnectStatus method of checking a connection fails in some circumstances, especially when using a wireless connection modem like for GSM/GPRS.

When a connection has first been established succesfully, and then network coverage is lost (like often happens for GSM/GPRS), the RAS status as retrieved with RasGetConnectStatus is still RASCS_Connected, while the modem has already dropped the connection.

I need to check the connection status and have to reconnect if the connection is lost.

Is there any other API for checking the status?

Thanks in advance..
___________________________
(link spam was deleted by admin)
Back to top
View user's profile Send private message
smjg



Joined: 29 Sep 2004
Posts: 41

PostPosted: Mon Jul 26, 2010 7:23 am    Post subject: Reply with quote

ebbenezer66 wrote:
I have a question about using bindings/win32 not running in vista.

__________________________________

Auto Parts
Car Parts

Why are you telling us this?
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Mon Jul 26, 2010 11:46 am    Post subject: Reply with quote

smjg wrote:
ebbenezer66 wrote:
I have a question about using bindings/win32 not running in vista.

Why are you telling us this?
It looks like a link spammer to me. (He's going to disappear.)
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Bindings All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group