Condividi:        

netapi32.lib

Discussioni e opinioni costruttive sul mondo dell'informatica.
Per la soluzione di problemi specifici fare riferimento alle sezioni di assistenza!

Moderatori: aurelio37, Anthony47, axelrox

netapi32.lib

Postdi rayden » 05/02/03 13:01

questa libreria non è presente su C++Bulder 1 sapete se ce ne sono di equivalenti?
Le uniche limitazioni che abbiamo sono quelle che ci poniamo da soli...
http://www.lightingandservices.com
http://www.lightingandservices.com/phoenix
rayden
Utente Senior
 
Post: 881
Iscritto il: 07/08/01 01:00

Sponsor
 

Postdi zello » 05/02/03 13:47

Uhm, no, però borland di solito include un buon programmino in grado di tirarti fuori il .lib da una .dll (non chiedermi il nome, cercalo nella directory bin del compilatore). Basta che gli passi in input netapi32.dll (directory system32).
Il faut être toujours ivre. Tout est là : c'est l'unique question. Pour ne pas sentir l'horrible fardeau du Temps qui brise vos épaules et vous penche vers la terre,il faut vous enivrer sans trêve...
Avatar utente
zello
Moderatore
 
Post: 2351
Iscritto il: 06/05/02 13:44

Postdi rayden » 05/02/03 15:58

vabbè, per quello non ho avuto problemi... ora ne ho un altro non mi funziona l'invio attraverso la funzione API osserva:

wchar_t msga[MAXLEN];
mbstowcs( msga, destination, MAXLEN );
msga[MAXLEN - 1] = L'\0';

NET_API_STATUS ris = NetMessageBufferSend( NULL, dest->Text.c_str(), NULL, (byte *) &msga[0], wcslen( msga ) * 2 );

le risposte possibili sono a me viene fuori sempre e solo "NERR_NameNotFound" come mai non lo ho capito... maggiori info le ho trovate quà: http://msdn.microsoft.com/library/defau ... ersend.asp

avete idee?

if ( ris == ERROR_ACCESS_DENIED )
{
ShowMessage("The user does not have access to the requested information.");
}
if ( ris == ERROR_INVALID_PARAMETER )
{
ShowMessage("The specified parameter is invalid.");
}
if ( ris == ERROR_NOT_SUPPORTED )
{
ShowMessage("This network request is not supported.");
}
if ( ris == NERR_NameNotFound )
{
ShowMessage("The user name could not be found.");
}
if ( ris == NERR_NetworkError )
{
ShowMessage("A general failure occurred in the network hardware.");
}
if ( ris == NERR_Success )
{
ShowMessage("Successful send");
}
Le uniche limitazioni che abbiamo sono quelle che ci poniamo da soli...
http://www.lightingandservices.com
http://www.lightingandservices.com/phoenix
rayden
Utente Senior
 
Post: 881
Iscritto il: 07/08/01 01:00

Postdi zello » 05/02/03 17:35

Premessa: mai usato netlib32.dll...

in Windows Server 2003

E questo da dove salta fuori ? :)

Tu hai registrato il messaggio usando NetMessageNameAdd? E naturalmente il servizio di messenger attivo, vero?

Per gli errori: non ti conviene usare switch?
Codice: Seleziona tutto
string msg;
switch(ris)
{
   case ERROR_ACCESS_DENIED:
      msg="The user does not have access to the requested information.";
      break;
   case ... ecc ecc
}
ShowMessage(msg.c_str());

}
Il faut être toujours ivre. Tout est là : c'est l'unique question. Pour ne pas sentir l'horrible fardeau du Temps qui brise vos épaules et vous penche vers la terre,il faut vous enivrer sans trêve...
Avatar utente
zello
Moderatore
 
Post: 2351
Iscritto il: 06/05/02 13:44

Postdi rayden » 05/02/03 17:47

si lo so che è meglio lo switch, ma preso da inkazzatura esagerata ho fatto una cosa di fretta... per qiamto riguarda il servizio di messanger, si è attivo, in quanto lo uso regolarmente con net send, invece non ho usato la funzione di registrazione del messaggio...
mo vedo un poco...

cmq tento di contattarti su ICQ ma sempre spento lo hai...
Le uniche limitazioni che abbiamo sono quelle che ci poniamo da soli...
http://www.lightingandservices.com
http://www.lightingandservices.com/phoenix
rayden
Utente Senior
 
Post: 881
Iscritto il: 07/08/01 01:00

Postdi rayden » 05/02/03 18:12

l'errore che mi dà la funzione NetMessageNameAdd e: NERR_AlreadyExists
il codice ora è:
wchar_t msga[MAXLEN];
mbstowcs( msga, destination, MAXLEN );
msga[MAXLEN - 1] = L'\0';
char* outmsg;
char* outmsg2;
NET_API_STATUS ris = NetMessageNameAdd(0, "alias");
switch (ris)
{
case ERROR_INVALID_PARAMETER:
outmsg = "The specified parameter is invalid.";
break;
case NERR_AlreadyExists:
outmsg = "The message alias already exists on this computer. For more information, see the following Remarks section.";
break;
case NERR_DuplicateName:
outmsg = "The name specified is already in use as a message alias on the network.";
break;
case NERR_NetworkError:
outmsg = "A general failure occurred in the network hardware.";
break;
case NERR_TooManyNames:
outmsg = "The maximum number of message aliases has been exceeded. ";
break;
case NERR_Success:
outmsg = "Name successfull on";
break;
}

ris = NetMessageBufferSend( 0, dest->Text.c_str(), 0, (byte *) &msga[0], wcslen( msga ) * 2 );
switch (ris)
{
case ERROR_ACCESS_DENIED:
outmsg2 = "The user does not have access to the requested information.";
break;
case ERROR_INVALID_PARAMETER:
outmsg2 = "The specified parameter is invalid.";
break;
case ERROR_NOT_SUPPORTED:
outmsg2 = "This network request is not supported.";
break;
case NERR_NameNotFound:
outmsg2 = "The user name could not be found.";
break;
case NERR_NetworkError:
outmsg2 = "A general failure occurred in the network hardware.";
break;
case NERR_Success:
outmsg2 = "Successful send";
break;
}

mentre l'errore sulla seconda funzione è sempre lo stesso... uhm...
Le uniche limitazioni che abbiamo sono quelle che ci poniamo da soli...
http://www.lightingandservices.com
http://www.lightingandservices.com/phoenix
rayden
Utente Senior
 
Post: 881
Iscritto il: 07/08/01 01:00

Postdi rayden » 05/02/03 18:25

inoltre netapi32.lib è fondamentale, ma non so dove trovarla, mo provo con google...
Le uniche limitazioni che abbiamo sono quelle che ci poniamo da soli...
http://www.lightingandservices.com
http://www.lightingandservices.com/phoenix
rayden
Utente Senior
 
Post: 881
Iscritto il: 07/08/01 01:00

Postdi rayden » 05/02/03 19:01

fermi tutti ce so riuscito, metto in ordine un poco di cose e poi vi spiego...
Le uniche limitazioni che abbiamo sono quelle che ci poniamo da soli...
http://www.lightingandservices.com
http://www.lightingandservices.com/phoenix
rayden
Utente Senior
 
Post: 881
Iscritto il: 07/08/01 01:00

Postdi zello » 05/02/03 21:24

Tre cose:
- non contare sulla mia presenza in ICQ - non ci sono quasi mai. Scrivimi in e-mail, fai prima.
- se non trovi il .lib, e non riesci a generarlo, puoi sempre importare netlib32.dll dinamicamente (con LoadLibrary) e procurarti dei puntatori alle funzioni con GetProcAddress
- "Windows 95/98/Me: Unsupported." - questo lo sai, immagino
- Hai provato a cambiare nome al messaggio?

Mandami i sorgenti (se non è enorme) via mail, quando ho tempo ci butto un occhio.

Ciao
Il faut être toujours ivre. Tout est là : c'est l'unique question. Pour ne pas sentir l'horrible fardeau du Temps qui brise vos épaules et vous penche vers la terre,il faut vous enivrer sans trêve...
Avatar utente
zello
Moderatore
 
Post: 2351
Iscritto il: 06/05/02 13:44

Postdi rayden » 06/02/03 09:37

bè, avrei potuto fare anche così, chiamando dinamicamente la libreria, però sono venuto a conoscenza del fatto che C++Builder ha gli header file delle api di sistema, non è stato necessario dunque importare la dll.

Per quanto riguarda i messaggi ho dei problemi con i nomi di invio ma è risolvibile... :D
Le uniche limitazioni che abbiamo sono quelle che ci poniamo da soli...
http://www.lightingandservices.com
http://www.lightingandservices.com/phoenix
rayden
Utente Senior
 
Post: 881
Iscritto il: 07/08/01 01:00


Torna a Discussioni


Topic correlati a "netapi32.lib":


Chi c’è in linea

Visitano il forum: Nessuno e 24 ospiti