Hi! I have a VB.NET app needs to be called from an asp page.For that i need a DLL of my app with a simple interface (4 functions and 1 property).How can i do this? I've tried to create a class library with those functions and then add my project, but i can´t use the classes i have there.Is this the correct way to do it?Or do i have to add each of the projects classes to the DLL i´m building? Thanks in advance. Never say never
carlos_rocha
Posts
-
DLL creation form vb.net project -
Get only part of a text fileTudo nice? Explicitamente na instrução não.Tens de procurar individualmente e detectar qual dos caracteres detectaste, o "<", o "," ou o ";". Para isso talvéz possas usar o método IndexOfAny().Este método retorna o índice da 1ª ocorrência de caracteres presentes num array.Acho k aí podes especificar os caracteres k desejas.Vê como funciona, onde estou n t posso dizer mais sobre este método. Outra coisa que podias fazer, mas só se esses caracteres apenas forem usados como inicio/fim de tag era fazer um replace e simplificar as tags ficando assim por exemplo só com "," ou ";".Ou seja substituir "<",">" e "," por ";" e assim só tinhas esse caracter pra pesquisar. Fica bem. PS:Pensei k eras brazuca por isso é k falei do fute. de praia...era pra t dar tanga, mas como és português n correu bem... :D Never say never
-
Selecting items in the ListView ControlHi! I've never done that but maybe you should check out the bindingContext property. Sorry i can't give you any more help. Never say never
-
Get only part of a text fileHi! Eu sou tuga rapaz. Eu uso uma função parecida com o k tu queres mas não a tenho aqui. Procuras o caracter de inicio e fim e testas se de facto o caracter k fecha a tag tem um índice superior ao 1º caracter.Depois se kiseres testar se de facto a string tá bem construída procuras um novo caracter de inicio de tag e vês se o índice dele é superior ao índice do caracter de fecho de tag. inicio = InStr(texto, "<") fim = InStr(texto, ">") inicio2 = InStr(inicio + 1, texto, "<") If inicio < fim AND fim < inicio2 Then myContents = Mid(texto, inicio + tagSize, fim - (inicio + tagSize)) End If splittedArray = Split(myContents,"/") (...) Meu, escrevi isto de cabeça...mas é +ou- isso, talvéz tenhas de fazer umas alterações para pôr isso mais fiável, mas a base é esta. Fica bem, irmão. PS: Os tugas deram banho aos brazucas no futebol de praia nas meias, mas dps na final com a frança...oops palhaços Never say never
-
Selecting items in the ListView ControlHi! 1 - Concerning adding items and associating an image to them you could associate an ImageList to the smallImageList or largeImageList property of the class and then when you're creating the items do: myListView.Items.Add(New ListViewItem("blablabla", myImageIndex)) myImageIndex is the imageList index of the image you whish to show in the item. 2- To show Info about ONE selected item you have to put this code in the doubleClick event of the Listview: myListView = CType(sender,ListView) ListViewSelectedText = myListView.SelectedItems(0).Text With this you're getting the text of the item.You can also have for example some info in the tag property... ListViewSelectedTag = myListView.SelectedItems(0).Tag NOTE: If you have the multiselect property active then you'll have to iterate through the selectedItems collection and get the info you need Never say never
-
Get only part of a text fileHi! Why don't you search for something inside <> or ;; and then split with the "/" delimiter? Never say never
-
How to use the select item of listview?Hi! I don't know if you're using multiselect or not but if you are not then you can only have one element selected so, you obtain the item by doing MyListView.SelectedItems(0) If you have multiselect = True then you can do this: Dim MyListViewColl As SelectedListViewItemCollection = MyListView.SelectedItems Dim MyListViewItem As ListViewItem For Each MyListViewItem In MyListViewColl (...) 'do whatever you want with the object Next Never say never
-
How to know the right click event?Hi! The Click event gives doesn't give you any kind of information, basically it only tells you that you clicked in a control. In your case, because you need to know if it was a left or right click you should use the MouseDown and/or MouseUp events because the MouseEventArgs object gives you that and another information. Never say never
-
Show new form without taking focus off first formYou scratch my back, i scratch yours. PS: metaphorically speaking of course :D Never say never
-
Show new form without taking focus off first formHi! I GOT IT.It was about time...i can't believe it took me a day and a half to accomplish this. :( I think the problem is in the topMost Property.After a bit of thinking, i didn't use that property in the form designer, what i simply did was this, 2 simple instructions(that's what pisses me off): ShowWindow(Me.Handle,SW_SHOWNOACTIVATE) 'SW_SHOWNOACTIVATE = 4 setWindowPos(Me.Handle,HWND_TOPMOST, XPos, YPos, myWidth, myHeight,SWP_NOACTIVATE) 'HWND_TOPMOST=-1 'SWP_NOACTIVATE=16 The first instruction tells the window how to behave when it appears. That constant tells it to not to steal the focus from other window. The second instruction places the window where you desire with your desired behaviour.Once again the constants mean that: 1-the window will appear as TopMost 2-the window will not steal the Focus AND IT WORKS FINE. Never say never
-
Show new form without taking focus off first formHi! I was trying to avoid that solution, but after a whole day of searching the web and grups, maybe i'm gonna follow that way. Last night at home i was trying to accomplish this, and i kind of got it (i don't understand why this works but... :D) : I was declaring the forms locally like dim myForm2 as New Form2 and then calling the showWindow() function.But then i declared the form as a class Member: Private myForm2 as Form2 and then in the init.Components method i did myForm2 = new myForm2 and then showed the form and it worked ok!!!Why is this?What's the difference between showing a form declared locally and another that is a class member? Never say never
-
Show new form without taking focus off first formHi! I read the articles related to message windows that popup but i still don't have the answer for my problem. I have a form which launches a new form (i want it to be a topMost form) but even with the ShowWindow() function the second form still gets focus.I tried a simpler example with a main form and a second that didn't contain any controls or painting code and it still gets the focus.This is my declaration of function.Am i doing anything wrong?When should i call showWindow()? _ Private Shared Function ShowWindow(ByVal hWnd As IntPtr, ByVal nCmdShow As Int32) As Boolean End Function (...) Dim myForm2 As New Form2 ShowWindow(myForm2.Handle, 4) '4 is the SW_SHOWNOACTIVATE value This doesn't work for me (using vb.net).Can anyone help me? Never say never
-
tab controlHi! What do you mean by code it?Add TabPages? Create a TabPage objects, assign some text to the Text property and then do TabControl.Controls.Add(myTabPage) and the tabControl will have a new tabPage.And so on... dim myTabPage as New TabPAge myTabPage.Text = "Tab1" (...) myTabControl.Controls.Add(myTabPage) Never say never
-
collections doubtHi!Thanks on the great insight.I think the app is fairly well designed.My issue is that i have a thread that does some processing with one object and another thread (that enumerates the collection) is checking out the state of the objects.When the processing level determines that the object has reached the end of its life it changes its state and the cleanup thread (the one that enumerates the collection) deals with the object cleanup and removal.I'm trying to synchronize at these two levels. What about readerWriterLock? That was my second choice.Doesn´t this strategy ensures security for reads and writes like you said? If this isn't ok i'll use mutexes and semaphores. Note:i didn´t had so far any concurency issue but i'm sure that when i release the app for beta testing some will go wrong :-D Once again thanks for all the help. Never say never
-
collections doubtHi! Thx for the answers.I've used before semaphores and mutexes with C in linux.I wanted a quick way to make sure the concurrency doesn´t raise any problems. My really problem isn´t how the locking mechanism works, but a "second level" of locking.For example o use sockets read async.When i complete a read i have directly the object which i keep in the collection(along with many others).The thing is that at this point i need to lock just the object, not the entire collection.But when i'm enumerating the collection i lock it because i want to access all objects.So, i'm divided in how i should do that, because if i lock the collection but that in the read function have access to the object i'll be able to modify it!!!That's not right. Sugestions? Never say never
-
collections doubtHi! But in order for the second thread to stay blocked i need to put the code in the first thread protected by a syncLock block right? Never say never
-
collections doubtHi! I have a collection where i keep objects of a certain type.From time to time i need to enumerate the collection and access some properties of that object to know if that object is obsolete and remove it from the collection. Many threads manipulate those objects, ones for reading others for writing. My question is: to assuere thread-safety should i lock the collection or the current Object being processed? I ask this because even though the collection is locked if another thread changes the object directly the lock to the collection is useless!!! Anyone can help me with this? Another question: if i have a synchronized version of the collection, if another thread modifies the collection through a synchronized version of the collection will it afect the first thread? thx in advance Never say never
-
WSAENOBUFS (socket error 10055)Hi! I have an app that communicates over tcp/ip. About 50 people use the app and had no problems launching and executing it.But that was this one person in which the program didn´t launch, it just crashed and the error was: "No Buffer Space Available -- A socket operation could not be performed because the system ran out of buffer space or the queue was full." This happens i think when i create a new TcpClient and connect to the server.The strangest thing is that this part is inside a try-catch block to get the socketException Exceptions!!! Any hints on this?The app runs fine on 50 other pc's but this one.Is it from my app or the pc ( I RATHER BLAME IT ON MICROSOFT ). By the way my socket buffer is 1k long, not MB. Thx in advance. Never say never
-
very strange socket error (winsock error 10055 i think)Hi! I have an app that communicates over tcp/ip. About 50 people use the app and had no problems launching and executing it.But that was this one person in which the program didn´t launch, it just crashed and the error was: "No Buffer Space Available -- A socket operation could not be performed because the system ran out of buffer space or the queue was full." This happens i think when i create a new TcpClient and connect to the server.The strangest thing is that this part is inside a try-catch block to get the socketException Exceptions!!! Any hints on this?The app runs fine on 50 other pc's but this one.Is it from my app or the pc ( I RATHER BLAME IT ON THE HARDWARE FOR A CHANGE :D ) Thx in advance. Never say never
-
running a process automaticallyso...you're gonna make a virus... TERRORIST :D Never say never I think i can help you with the first requisite the second one i only know how to do it manually (put the shortcut in the Startup folder... :P) use the Process class and its Start method:
Dim myProcess As New Process myProcess.Start("myApp.exe") (...)