Jump to content
Xtreme .Net Talk

Heike

Avatar/Signature
  • Posts

    56
  • Joined

  • Last visited

Everything posted by Heike

  1. I created a DataGridNoActiveCellColumnMultiple by inheriting from DataGridTextBoxColumn. I overloaded the paint procedure: Protected Overloads Overrides Sub Paint(ByVal g As Graphics, ByVal bounds As Rectangle, ByVal source As CurrencyManager, ByVal rowNum As Integer, ByVal backBrush As Brush, ByVal foreBrush As Brush, ByVal alignToRight As Boolean) Try If Not mblnMitKonvertierung Then MyBase.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight) Else Select Case mintKonvertierung Case enmKonvertierungsArt.kaZugriffsart Dim intZugriff As Integer intZugriff = CInt(CType(source.Current, DataRowView).DataView.Table.Rows(rowNum).Item("Zugriffsart")) MyBase.PaintText(g, bounds, mstrZugriff(intZugriff), backBrush, foreBrush, alignToRight) Case enmKonvertierungsArt.kaBenutzer Dim strKuerzel As Char Dim strGruppe As String strKuerzel = CChar(CType(source.Current, DataRowView).DataView.Table.Rows(rowNum).Item("Icon")) strGruppe = CStr(CType(source.Current, DataRowView).DataView.Table.Rows(rowNum).Item("Benutzer")) MyBase.PaintText(g, bounds, mstrName(strKuerzel, strGruppe), backBrush, foreBrush, alignToRight) End Select End If Catch ex As System.Exception 'do something End Try End Sub Now, sometimes (not reproduceable) I get following error: The object is currently in use elsewhere Unfortunately I have no idea what to do?!
  2. Thank you very much. I only made one try, yet, but it seems to work. I will test it more intensely but I'm sure my problem will be solved.
  3. Indeed, I'm getting the idea but don't know exactly what to do. I copied the source and tried to convert it to vb but the first error I get is "classes can inherit only from other classes". Therefore I would be obliged if you could give me a vb version. Thanks
  4. Good idea but unfortunately it only leads to "Specified cast is not valid".
  5. OK. But how can I get the handle of my word app?
  6. There is an application that calls an EXE that I developped in VB.NET This EXE opens a word application: objWordInstance = GetObject(, "Word.Application") If objWordInstance Is Nothing Then objWordInstance = CreateObject("Word.Application") End If After that I try to show a MessageBox but it is always hidden behind my word application. Any idea what to do?
  7. I (unfortunately only sometimes) get the error message "QueryInterface for interface System.Runtime.InteropServices.UCOMIConnectionPoint failed". What does that mean? This morning I got it when debugging at the following statement: RemoveHandler CType(objWordInstance, Word.ApplicationEvents2_Event).DocumentBeforeClose, AddressOf DocumentBeforeClose Random?
  8. Yes, my other application is checking the return code by using GetExitCodeProcess. I wrote a simple program in VB 6 that creates a process (like I expect from the other application) and then waits and after my EXE finshed gets the return code. There everything works fine. My first thought was that the other application is not able to read my return code but there is only called an API function and therefore I would think that it doesn't matter which language it uses. ???????
  9. I am developing an EXE in VB.NET. This EXE is called by another program and that program waits until my EXE has finished (I think by using WaitForSingleObject but I'm not sure). My problem now is that the calling application wants to receive a return code. It is reading the return code by GetExitCodeProcess. But how can I send the return code? I tried Environment.Exit(42) and Environment.ExitCode = 42 and ExitProcess(42) (API) but everytime I get a 0. Are there some more possibilities to send a return code?
  10. I am developing an EXE (type Windows Application) in VB.NET. This EXE is called by an external program. But unfortunately it is necessary to return a value to that external program. Is there a possibility to do so? If yes, how?
  11. I developed an EXE (VB.NET) which is called by a COOL:Plex program. Now I got the following job: if something specific happens "send a windows message with number 42" because that let's e.g. refresh a TreeView (in that COOL:Plex program). My question now is: how can I do that? I have no idea because I never worked with windows messages before (not in C neither in VB 6.0). After searching everywhere in the www I seem to know that I must use the API-Function SendMessage. Does anyone have a simple example how to use it? Thx
  12. My job is to develop a DLL in VB.NET. This DLL should then be called by a programm written in COOL:Plex. If I try to do this, I get the following error: Function <name> could not be called because the associated DLL is no COOL:Plex function Unfortunately I'm not familiar with COOL:Plex and therefore I have no idea what to do.
  13. Even if using threads it seems to be more difficult than I thought. It seems to work... My function fills my DocVariables and during that I see my animated gif and it is(!) animated. But: how can I tell that form when to close? Maybe you can have one look at my code and give me a hint?! I created a new class: Public Class IBSThread Public objQueryParameters As ArrayList Public Doc As Word.Document Public mobjProperties As DocProperties Public blnPushed As Boolean Public IBSWord As New comIBS_Word() Public Event Done() Public Sub Sub1() IBSWord.FillDocVariables(Doc, mobjProperties, objQueryParameters, Not blnPushed) RaiseEvent Done() End Sub End Class And this is the "main" program (frmGif is declared modally) With objConnect.objIBS_Word .ResetDocVariables(...) .ParameterZufuegen = False .DokumentVariablen = mobjProperties If Not objWordInstance Is Nothing Then Dim myThread As Threading.Thread .IstVorschau = True objQueryParameters = New ArrayList() objQueryParameters.Clear() objQueryParameters.Add(objIBS_INIT.ibsKrankenhausNr) objQueryParameters.Add(objIBS_INIT.ibsAbteilung) objQueryParameters.Add(objIBS_INIT.ibsVorlage) clsThread = New IBSThread() clsThread.blnPushed = Me.tlbButtonVorNach.Pushed clsThread.Doc = CType(objWordInstance.ActiveDocument, Word.Document) clsThread.mobjProperties = mobjProperties clsThread.objQueryParameters = objQueryParameters clsThread.IBSWord = objConnect.objIBS_Word myThread = New Threading.Thread(AddressOf clsThread.Sub1) myThread.Name = "IBS Thread" myThread.Start() frmGif = New frmIBS_Beschaeftigt() frmGif.ShowDialog() End if End with Here's the handling of the event Private Sub clsThread_Done() Handles clsThread.Done frmGif.Close() ChangeSize(False) End Sub But my form is not being closed! Why?
  14. The code snippit is only one example. I want to use my animated gif at several places. I am developing an AddIn for Word(2000). The snippit I copied here is used to parse to one document to search for DocVariables in it. To each of this DocVariable I have an entry in my CustomDocumentProperties containing a SQL-statement. I must execute that SQL-statement and the value I get becomes the value of the DocVariable. Yes, when all my DocVariables are filled (which means the execution of that function is finished), my gif starts to play. But I want it to be parallel. I think the only way may be to do that by using several threads???
  15. Unfortunately it makes no difference.... This is how I do it, maybe you can see an error. If Not objWordInstance Is Nothing Then frmGif = New frmIBS_Beschaeftigt() frmGif.AnimateImage() [...] .FillDocVariables(...) frmGif.Close() frmGif = Nothing End If where frmGif is my form with the animated gif and .FillDocVariables is the sub whose execution should be shown by that gif.
  16. I want to show an animated gif if some execution is done instead of setting the cursor to "WaitCursor". At the time I would set my cursor I openl a form which contains an animated gif. But the gif is only animated after my execution finished. What's wrong?
  17. No, it's not a 3rd party combobox. I created my own style by using inheritance. Yes I am sure that the combobox is updating the dataset. At least if my form is big enough to show the whole grid, it is doing so. Can there be a reason why it is different when scrolling is needed?
  18. I think, I'm getting mad..... I have a datagrid consisting of several derived columns (comboboxes). That comboboxes are filled by a dataset. They all have an empty entry and are editable. If I can see the whole datagrid, everything works fine. If I have to scroll from left to right the value entered in a combobox not been visible before scrolling is forgotten. But only if I enter something. If I select an entry of the combobox everything works just like expected. Any idea???
  19. In VB 6.0 it was possible to jump to one TabPage by using ALT plus a defined key, which had an underscore. E. g. by pressing ALT + P I could directly jump to a TabPage "Print". Until now I did not find anything like that in VB.NET. Can you help me?
  20. Is there a (simple) possibility to adjust a form with all controls if settings like font change? I just changed my settings from 1280x1024 to 1024x768 and my font from small to big and all my forms look horrible. I want them to look just like before. Even the font of a label or something like that should be the same like before. Thanks
  21. It seems like I solved the problem a few minutes ago. I set the property AllowDrop of my toolbar to FALSE and until now the error hasn't occured any more...
  22. Maybe this can help anyone to give me a hint... The original message is: ************** Exception Text ************** System.InvalidOperationException: DragDrop registration failed. ---> System.Threading.ThreadStateException: The current thread must set to Single Thread Apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
  23. That's not easy to answer.... I'm developing an AddIn for Word2000 There everything works fine. Additional to that I have a simple EXE. This EXE opens word and then uses my AddIn. Two of my forms causes the described error. Therefore I'm not sure, if any code would help. My guess is, that it may be caused by the toolbar which is on both forms. I have other forms within my AddIn which have no toolbar and those forms all work. Heike
  24. Has anyone ever had that error message? What may be wrong?
  25. Thanks, but that doesn't work either. I'm enumerationg my own collection because I had to create my own type because the base TreeView does not support multiple selection.
×
×
  • Create New...