Daca as putea fi sigura ca LoadLib cauta intai in system32 si abia apoi in PATH (sau in subdirectoarele directorului curent), ar fi suficient sa trimit functiei doar numele librariei, fara sa fie nevoie sa ii dau calea completa.<br>Ideea e ca pentru win 2003 si win 2008 trebuie sa folosesc libraria din system32, chiar daca ea exista sau nu intr-un subdirector al directorului curent.<br><br>Cred ca totusi o sa folosesc PathFileExists ca sa testez daca exista dll-ul in system 32 si daca da sa folosesc LoadLibrary trimitand calea completa catre system32. Daca nu exista dll-ul in system32, o sa trimit doar numele dll-ului ca parametru la LoadLibrary si o sa il incarce din primul loc in care il gaseste (aici ar trebui sa apara dll-ul creat de mine). <br>O sa modific putin implementarea ca sa scot pasul in care doar verificam existenta fisierului.<br><br>Multumesc pentru ajutor.<br><br><b><i>Maximilian Machedon <maximilian.machedon@gmail.com></i></b> wrote:<blockquote
class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Si de ce e rau daca o incarci? Folosind acel flag nu se executa cod din ea.<br><br> <div class="gmail_quote">2008/5/29 mihaela m <<a href="mailto:mihaela_im86@yahoo.com">mihaela_im86@yahoo.com</a>>:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">Inca o intrebare: prin <br>1. The directory from which the application loaded.<br>ar trebui sa inteleg si subdirectoarele directorului? <br> <br>Ca sa explic mai bine care era problema, eu am nevoie de o librarie care exista pe windows 2003 si windows 2008 in system32, dar pe 2000 o creez eu intr-un director predefinit in aplicatie. <br>De asta vroiam doar sa verific existenta ea, fara sa o incarc.<br> <br>Multumes pentru raspunsurile prompte :). <div class="Ih2E3d"><br><br><b><i>Lucian Adrian Grijincu <<a
href="mailto:lucian.grijincu@gmail.com" target="_blank">lucian.grijincu@gmail.com</a>></i></b> wrote:</div> <blockquote style="border-left: 2px solid rgb(16, 16, 255); padding-left: 5px; margin-left: 5px;"> <div class="Ih2E3d">stiu, LoadLib cauta in mai multe locuri si are niste prioritati bine<br>determinate.<br><br>am luat "(presupun ca e setata in PATH)" ca o premisă.<br><br><br></div>2008/5/29 Maximilian Machedon : <div class="Ih2E3d"><br>><br>> Tin sa nu fiu de acord. Nu folosi path-ul pentru ca poti obtine altceva<br>> decat ar incarca LoadLibrary.<br>><br>> Vezi <a href="http://msdn.microsoft.com/en-us/library/ms682586.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms682586.aspx</a><br> ><br></div>> 2008/5/29 Lucian Adrian Grijincu :<br>>><br>>> 2008/5/29 mihaela m : <div class="Ih2E3d"><br>>> > Functia si incarca libraria.<br>>> tu vrei doar sa vezi daca fisierul ăla există?<br>>> Te poți
uita in PATH: parsezi manual șirul și apendezi numele dll-ului<br>>> la fiecare cale de director din PATH.<br> >> verifici daca fisierul exista (exista o func. care iti zice daca un<br>>> fisier exista sau nu, i-am uitat numele).<br>>><br>>> > In plus trebuie sa fie suportata pe orice Windows Server de la 2000 la<br> >> > 2008.<br>>> ><br>>> Client Requires Windows Vista, Windows XP, or Windows 2000 Professional.<br>>> Server Requires Windows Server 2008, Windows Server 2003, or Windows<br>>> 2000 Server.<br> >><br>>><br></div> <div class="Ih2E3d">>> > Maximilian Machedon wrote:<br>>> ><br>>> > LoadLibraryEx()<br>>> > <a href="http://msdn.microsoft.com/en-us/library/ms684179.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms684179.aspx</a><br> >> ><br>>> > Foloseste flag-ul LOAD_LIBRARY_AS_DATAFILE.<br></div>>> >
2008/5/29 mihaela m : <div> <div></div> <div class="Wj3C7c"><br>>> >><br>>> >> Buna.<br>>> >><br>>> >> Stie cineva cum as putea verifica existenta unui fisier .dll fara sa<br>>> >> incerc sa il deschid sau sa incarc libraria? As prefera o varianta in<br> >> >> care<br>>> >> nu trebuie sa ii dau calea completa catre librarie (presupun ca e<br>>> >> setata in<br>>> >> PATH).<br>>> >><br>>> >><br>>> >> Multumesc,<br> >> >> Mihaela Mihalache<br>>> >><br>>> >> _______________________________________________<br>>> >> so mailing list<br>>> >> <a href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br> >> >> <a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so"
target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br>>> >><br>>> ><br>>> > _______________________________________________<br> >> > so mailing list<br>>> > <a href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br>>> > <a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br> >> ><br>>> ><br>>> > _______________________________________________<br>>> > so mailing list<br>>> > <a href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br> >> > <a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br>>> ><br>>> ><br>>><br>>><br>>><br> >> --<br>>> Lucian<br>>>
_______________________________________________<br>>> so mailing list<br>>> <a href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br>>> <a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br> ><br>><br>> _______________________________________________<br>> so mailing list<br>> <a href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br>> <a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br> ><br>><br><br><br><br>-- <br>Lucian<br>_______________________________________________<br>so mailing list<br><a href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br><a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br>
</div></div></blockquote><br> <div></div><br>_______________________________________________<br>so mailing list<br><a href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a><br><a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br> <br></blockquote></div><br> _______________________________________________<br>so mailing list<br>so@cursuri.cs.pub.ro<br>http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so<br></blockquote><br><p>