http://www.aspheute.com/english/20000828.asp
Just.Google("use +com dll +in .net"); :-) Gruß, Thomas _____________________________________ http://blogs.dotnetgerman.com/thomas/ > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Basri Shabani > Sent: Friday, February 04, 2005 11:07 PM > To: asp.net@glengamoi.com > Subject: AW: [Asp.net] externe dll einbeziehen > > > Es handelt sich um COM > > -----Ursprüngliche Nachricht----- > Von: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Im > Auftrag von Thomas Bandt > Gesendet: Freitag, 4. Februar 2005 23:03 > An: asp.net@glengamoi.com > Betreff: RE: [Asp.net] externe dll einbeziehen > > Spezifiziere mal "dll" - COM oder .NET? Wenn .NET reicht es > aus, die ins > /bin-Verzeichnis deines Projektes zu kopieren. > > Gruß, Thomas > _____________________________________ > http://blogs.dotnetgerman.com/thomas/ > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Basri Shabani > > Sent: Friday, February 04, 2005 9:56 PM > > To: asp.net@glengamoi.com > > Subject: [Asp.net] externe dll einbeziehen > > > > Hallo Leute, > > > > ich muss für ein intranet programm (asp.net mit c#) auf eine dll > > zugreifen mit deren hilfe man auf eine fremde datenbank > user anlegen > > kann usw. ich habe auch eine beispiel dafür gefunden wie man das > > machen kann, jedoch ist diese beispiel (siehe unten) in c++ > > geschrieben. kann jemand mir helfen und erklären, wie man das in c# > > macht? Danke im Voraus > > > > > > > > mfg bas > > > > > > > > Example 1: Creating a new user account > > > > As an example, we will try to insert a new user ”mary” into > > OmniTracker’s database. > > > > * Create a new dialog-based project using the ”MFC > > AppWizard (exe)”. > > > > * Add a button called ”Add User” to the dialog. > > > > * Assign a handler OnAddUser() to the button, and fill it > > with the following code: > > > > IOtApplicationPtr pApp; > > > > HRESULT hr = pApp.CreateInstance(__uuidof(OtApplication), NULL, > > > > CLSCTX_INPROC_SERVER); > > > > if (FAILED(hr)) > > > > { > > > > CString str; > > > > str.Format ("CreateInstance() failed: 0x%08lx", > > > > (ULONG) hr); > > > > AfxMessageBox (str); > > > > } > > > > try { > > > > IOtSessionPtr pSession; > > > > pSession = pApp->MakeSession("hostname", 4567, > > > > "superuser", "password"); > > > > > > > > IOtUsersPtr pUsers; > > > > pUsers = pSession->Users; > > > > > > > > IOtUserPtr pUser; > > > > pUser = pUsers->Add(); > > > > > > > > pUser->LoginName = "mary"; > > > > pUser->EmailAddress = "[EMAIL PROTECTED]"; > > > > pUser->Password = "65gh45"; > > > > pUser->DisplayName = "Mary"; > > > > pUser->Save(); > > > > > > > > } catch(_com_error& e) { > > > > _bstr_t bstrDescription(e.Description()); > > > > AfxMessageBox((LPCTSTR) bstrDescription); > > > > } > > > > > > > > > > * At the top of the file containing OnAddUser(), add the > > following line: > > > > #import "otaut.tlb" no_namespace > > > > This imports the definitions from the OmniTracker Automation > > interface. > > > > * Make sure, that the OmniTracker installation directory > > is part of the list of the C++ preprocessor ‘s include directories. > > > > * In the InitInstance() routine of your application, > > initialize COM by including the following lines: > > > > HRESULT hr = CoInitialize(NULL); > > > > if (FAILED(hr)) > > > > { > > > > AfxMessageBox ("Cannot initialize COM!"); > > > > return FALSE; > > > > } > > > > > > > > * Compile and link the source files, and execute the program. > > > > > > > > > _______________________________________________ > Asp.net Mailingliste, Postings senden an: > Asp.net@glengamoi.com > An-/Abmeldung und Suchfunktion unter: > http://www.glengamoi.com/mailman/listinfo/asp.net > > > _______________________________________________ > Asp.net Mailingliste, Postings senden an: > Asp.net@glengamoi.com > An-/Abmeldung und Suchfunktion unter: > http://www.glengamoi.com/mailman/listinfo/asp.net > _______________________________________________ Asp.net Mailingliste, Postings senden an: Asp.net@glengamoi.com An-/Abmeldung und Suchfunktion unter: http://www.glengamoi.com/mailman/listinfo/asp.net